Prisma1: @model and @isUnique directives not included in introspection result

Created on 19 Oct 2017  路  2Comments  路  Source: prisma/prisma1

Current behavior

When trying to introspect the schema of a Graphcool endpoint in order to use the result with apollo-codegen, the introspection result is missing some directives like @model and @isUnique, causing apollo-codegen to fail.

Reproduction

$ apollo-codegen introspect-schema <simple Graphcool endpoint> --output schema.json
$ apollo-codegen generate types.graphql --target ts --schema schema.json
.../types.graphql: Unknown directive "model".
.../types.graphql: Unknown directive "isUnique".
.../types.graphql: Unknown directive "isUnique".

Expected behavior?

The expected behavior would be for apollo-codegen generate ... to succeed. According to https://github.com/apollographql/apollo-codegen/issues/118#issuecomment-302415550, this could be an bug in Graphcool.

Most helpful comment

I'm running into this issue as well. apollo-codegen actually runs for me, but the graphql plugin for Intellij IDEA constantly complains about not understanding these directives, as they are not introspectable from the schema. Is there a workaround that doesn't involve manually adding them to the schema each time it changes?

All 2 comments

I'm running into this issue as well. apollo-codegen actually runs for me, but the graphql plugin for Intellij IDEA constantly complains about not understanding these directives, as they are not introspectable from the schema. Is there a workaround that doesn't involve manually adding them to the schema each time it changes?

This issue has been moved to graphcool/graphcool-framework.

Was this page helpful?
0 / 5 - 0 ratings