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 section Functions
Link to this function
new(url, headers \\ [])
View Source
new(String.t(), Keyword.t()) :: Grapher.SchemaContext.t()
Creates a new Schema Context for the given URL. Currently the only configuration available beyond the url are HTTP headers.
Parameters
url
: TheURL
to which queries and mutations should be sent for this Schemaheaders
: 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"]}