Skip to content

[Feature request] Provide parse, compile, merge and check functions #143

@gyzerok

Description

@gyzerok

It would be cool if you can provide functionality for parsing, merging and compiling GraphQL queries. So not only Relay can use awesome features of GraphQL.

  1. parse function should parse GraphQL query string into structure like info object which you can get in resolve function.
  2. compile function should be an opponent for parse
  3. merge function should merge two info objects to later perform optimised query to the server.

Consider this example:

query FirstQuery {
  ... on Root {
    todos: todos(count: 5) {
      _id,
      text
    }
  }
}

query SecondQuery {
  ... on Root {
    todos: todos(count: 6) {
      _id,
      createdAt
    }
  }
}

Using suggested functions it can be merged in:

query OptimizedQuery {
  ... on Root {
    todos: todos(count: 6) {
      _id,
      text,
      createdAt
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions