Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Fix comment in generated schema #2047

Closed
marktani opened this issue Mar 8, 2018 · 4 comments
Closed

Fix comment in generated schema #2047

marktani opened this issue Mar 8, 2018 · 4 comments

Comments

@marktani
Copy link
Contributor

marktani commented Mar 8, 2018

@johannpinson commented on Thu Mar 08 2018

I have a little bug about the syntax in Visual Studio Code, because one comment isn't generated to the new line:

https://github.com/graphcool/graphql-import/blob/4458d2955d9319ca2527b1a770438104a5f3c092/fixtures/complex/b.graphql#L9152-L9156

This is the actual render in VSC:
capture d ecran 2018-03-08 a 17 29 40

It seems that the """ comment tag must start in a new line to avoid the IDE to misunderstand the color syntax (see the minimap on the right)

It must be like this:
capture d ecran 2018-03-08 a 17 29 34

Thanks 😀

(PS: maybe also about the VSC plugin to graphQL syntax because I don't have it for Atom)

@johannpinson
Copy link
Contributor

Hey @marktani

I saw that on previous version on prisma (1.2.x), I don't have this lot of comments inside the GraphQL schema generated.

After looking the introspection schema, in my "old" and "new" projects I always see the comments in the result.
There is a new option for the CLI (prisma or graphql-cli) to disable the adding of this comments?
(because it seems it will be double the size of the file)

@johannpinson
Copy link
Contributor

Ok find, the bug seems to be related to the graphql-js repository itself.

I see a change in the schemaPrinter.js about this here:
graphql/graphql-js@a722af7#diff-71ba52e9c625f826d2b0df2963c8633a

@johannpinson
Copy link
Contributor

Hi @marktani

I made some test locally, and I see the problem here:

https://github.com/graphcool/prisma/blob/47e811530cedfe4b8ea2fd7821e788a3d3aab2db/cli/packages/prisma-cli-core/src/commands/deploy/printSchema.ts#L29-L45

I print in the console the sdl and newSdl to see the difference and after the reorder, it seems to be here the change which delete the \n after the node.

I will open a issue directly inside the graphql-js repository.

@marktani
Copy link
Contributor Author

Please track graphql/graphql-js#1285 for further discussion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants