Skip to content

Top-level function to take queries and return responses #60

@jml

Description

@jml

We have parsing, validation, resolving, and a response object. We need to string them all together.

Notes:

the 'schema' is defined by the server types, an initial value, and any supported directives (although we'll probably skip those for first release) -- so that's the server's input

the client's input is a query document, a variable map, and an optional name of an operation to run. Not sure how these are actually delivered to us.

the output is the Response object in our Output.hs module

overall process is:

  1. parse query (if it fails, respond with PreExecutionFailure)
  2. transform the AST into something valid, ignoring type checks, but making sure that arguments aren't duplicated, no circular references. (if fail, PreExecutionError)
    Note that we don't need the schema or the variables yet.
  3. substitute in the variables. now everything is literal.
  4. apply the directives. probably hard-code @Skip & @include for the first release. if fail, execution error, and continue with fragments without bad directives
    We now have something that's just objects & fragments
  5. "collect the fields" to avoid duplicate processing (c.f. https://facebook.github.io/graphql/#sec-Field-Collection). still not 100% sure about this.
  6. delegate to server-supplied code, collecting any results and errors
  7. wrap whatever we've got off in a Response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions