prisma-labs / prisma-binding

GraphQL Binding for Prisma 1 (using GraphQL schema delegation)
https://www.prisma.io/docs/prisma-graphql-api/prisma-bindings/prisma-bindings-prb1/
MIT License
476 stars 44 forks source link

[bug] not importing related .grapgql files during codegen #168

Closed alvis closed 6 years ago

alvis commented 6 years ago

With 2.0, related .graphql files are no longer imported into the schema when we run graphql codegen. It is due to a bug that prisma-binding do not handle any import syntax at the moment. See line 73: https://github.com/prismagraphql/prisma-binding/blob/ef7fc575a8a5473db2f48574c488c71ca181bf9f/src/bin.ts#L71-L86

To fix it, we should wrap it with importSchema from graphql-import, i.e.

return buildSchema(importSchema(input))
schickling commented 6 years ago

Thanks a lot for reporting this @alvis. @timsuchanek will shortly look into this and merge your PR :shipit: