Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
854 views
in Technique[技术] by (71.8m points)

plugins - GraphQL schema management

Is there a plugin or way to rearrange a single graphql schema file. Basically I want my graphql schema to be more organized. For example, All types should be at the top, followed by type Query followed by Mutations followed by Subscription and so on. Something similar to the code arrangement we do with class files in Intellij or other IDEs (i.e, constants at the top, followed by private variable, methods and so on)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes! There is the great package called format-graphql by Gajus Kuizinas that does exactly this -- enforcing consistent style on your schema. It is somewhat opinionated, so you can either 1) deal with the current custom options provided when you configure the package or 2) fork it, and rewrite this core utility to achieve the desired effect.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...