Module: FragmentGraphQl
- Extended by:
- T::Sig
- Defined in:
- lib/fragment_client.rb
Overview
A support module for the client
Constant Summary collapse
- HTTP =
T.let(GraphQL::Client.const_get(:HTTP).new('https://api.fragment.dev/graphql') do extend T::Sig sig { params(context: T.untyped).returns(T::Hash[T.untyped, T.untyped]) } def headers(context) { 'Authorization' => format('Bearer %s', context[:access_token]) } end end, GraphQL::Client::HTTP)
- Schema =
T.let(GraphQL::Client.load_schema("#{__dir__}/fragment.schema.json"), T.untyped)
- Client =
T.let(GraphQL::Client.new(schema: Schema, execute: HTTP), GraphQL::Client)
- Queries =
T.let(Client.parse( File.read("#{__dir__}/queries.graphql") ), T.untyped)