mesosphere/reactive-graphql

`graphql` signature diverges with standard graphql-js's one

alexstrat opened this issue ยท 2 comments

The common signature of the function graphql in reactive-graphql differs from graphql-js.

With graphql-js the signature is roughly:

import { graphql } from 'graphql'; 

graphql(schema: GraphQLSchema, query: Source | string, context?: object)..

While with reactive-graphql:

import graphql from 'reactive-graphql'; 

graphql(query: DocumentNode, schema: GraphQLSchema, context: object) ..

Note the differences:

  • the default import vs the "named" import
  • query and schema arguments position are inverted
  • the type of query is a string (or Source) in standard implementation and transformed in DocumentNode in the implementation while in reactive version it expects a DocumentNode directly
  • context is optional

These differences are more or less minor, but wanted to know if they are intended or not, and thus if maintainer would be open to accepting a PR fixing this.

#6 can be added as divergent signature issue

๐ŸŽ‰ This issue has been resolved in version 3.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€