Graphql-tools: buildSchemaFromTypeDefinitions crashes on type implementing multiple interfaces

Created on 9 Feb 2018  路  5Comments  路  Source: ardatan/graphql-tools

I just upgraded my apollo / graphql-tools packages to latest and ran into this running my test suite.

When parsing a schema containing this line, the tests error out with GraphQLError: Syntax Error: Unexpected Name GeoInCounty

type ZipCode implements Geo, GeoInCounty, GeoInState {
  fullyQualifiedName: String!

So it seems like it can't handle this multi implements syntax.

Stack trace:

      at syntaxError (node_modules/graphql/error/syntaxError.js:24:10)
      at unexpected (node_modules/graphql/language/parser.js:1322:33)
      at parseDefinition (node_modules/graphql/language/parser.js:152:9)
      at parseDocument (node_modules/graphql/language/parser.js:110:22)
      at Object.parse (node_modules/graphql/language/parser.js:38:10)
      at buildSchemaFromTypeDefinitions (node_modules/graphql-tools/dist/schemaGenerator.js:132:33)
      at _generateSchema (node_modules/graphql-tools/dist/schemaGenerator.js:54:18)
      at makeExecutableSchema (node_modules/graphql-tools/dist/schemaGenerator.js:70:20)
      at Object.<anonymous> (testing/mockHelpers.js:96:70)
      at Object.<anonymous> (testing/testHelpers.js:75:20)
      at Object.<anonymous> (pages/__tests__/local_search.test.js:19:20)

Most helpful comment

The syntax is changed, you should use &, not ,.

All 5 comments

Reverting to graphql-tools 2.7.2 fixed it for me

It's an issue in graphql 0.12 parser. Upgrade to graphql 0.13 to fix.

@freiksenet I'm have the same problem with graphql-tools 2.21.0 and graphql 0.13.1

The syntax is changed, you should use &, not ,.

got it, thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

confuser picture confuser  路  4Comments

udisun picture udisun  路  3Comments

adamkl picture adamkl  路  3Comments

capaj picture capaj  路  4Comments

brennantaylor picture brennantaylor  路  4Comments