dangcuuson / graphql-schema-typescript

Generate TypeScript from GraphQL's schema type definitions
191 stars 36 forks source link

Incorrect usage of `graphql-js` #26

Closed deser closed 5 years ago

deser commented 5 years ago

From https://graphql.org/graphql-js/:

// Run the GraphQL query '{ hello }' and print out the response
graphql(schema, '{ hello }', root).then((response) => {
  console.log(response);
});

In src/utils/:

 await graphql({ schema: schema, source: introspectionQuery });
deser commented 5 years ago

And in source-code: image

deser commented 5 years ago

Created pull: https://github.com/dangcuuson/graphql-schema-typescript/pull/27

dangcuuson commented 5 years ago

Actually graphql-js support both syntax (single arg & multiple args) via this line

But the es-lint is a nice addition so I'll accep the PR.

Cheers.