Grapher v0.6.0 Grapher.SchemaContext View Source

Defines a GraphQL Schema context

Link to this section Summary

Functions

Creates a new Schema Context for the given URL. Currently the only configuration available beyond the url are HTTP headers

Link to this section Types

Link to this type t() View Source
t() :: %Grapher.SchemaContext{headers: Keyword.t(), url: String.t()}

Link to this section Functions

Creates a new Schema Context for the given URL. Currently the only configuration available beyond the url are HTTP headers.

Parameters

  • url: The URL to which queries and mutations should be sent for this Schema
  • headers: Optional HTTP Headers to be included with each request, this will default to [] if nothing is given

Examples

iex> SchemaContext.new("http://www.example.xyz/api")
%SchemaContext{url: "http://www.example.xyz/api", headers: []}

iex> SchemaContext.new("http://www.example.com/api", ["Authentication": "My Token"])
%SchemaContext{url: "http://www.example.com/api", headers: ["Authentication": "My Token"]}