Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
What we need
gen-graphql-schema
helps to scan all graphql events, create graphql schema from event schema and create resolvers also.Steps to use graphql plugin in project :
godspeed plugin add
and selectgraphql-as-eventsource
to install graphql plugin.gen-graphql-schema
to auto generate graphql schema.gen-graphql-schema
command.godspeed dev
to start dev server. you can see Apollo sandbox UI in localhost:4000 by default. From there you can do queries or mutations.How we will approach
gen-graphql-schema
in cli to automate above 2 steps.What i tested:
gen-grapql-schema
command manually. It perfectly generating schema of all graphql event sources.For example we have 2 graphql event sources apollo1, apollo2.
Step 1: It asks
select your graphql events
and provide list of event sources we have in src/eventsource folder. Assume he selected apollo1, apollo2.step 2: This command filters all events of this event sources separately and generates 2 swagger schema files in .temp folder.
step 3: converts swagger schema to apollo1.graphql and apollo2.graphql in .src/eventsources folder.
When he start server, plugin directly searches in
src/eventsource folder for schema files and starts graphql server.
While i am testing this code perfectly implemented above steps.
graphql plugin PR https://github.com/godspeedsystems/gs-plugins/pull/76
Issue linkhttps://github.com/godspeedsystems/gs-plugins/issues/70