This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Implements the initial GraphQL server in Ruby #39
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install the current recommended default files and structure through this command: rails generate graphql:install See: http://graphql-ruby.org/schema/generators#graphqlinstall
Note that I started creating a sub directory for query types. This is so that we don’t have all of the queries, for all of the models, all inside of one large file. This encapsulate’s each model’s query logic inside of its own file, and then includes it in the main “app/graphql/types/query_type.rb” file. This file is the one that is wired up to the schema, through the query root entry point. I derived this implementation pattern from the HasRecommendedItems section of: http://graphql-ruby.org/fields/resolvers.html
Now queries can be organized by the model (or any common theme) in which they fall under. And each query resides in its own file. The queries for a given model (or theme) role up into a manifest of queries. This identifies all of the queries currently available for the given model (or theme). Each model’s manifest role’s up into the root query, that is passed to the schema. Which is the expectation and pattern set by GraphQL and the GraphQL gem.
This commit: - implements the create and update mutations for Statistic - sets the basic pattern for mutations, re: file/code organization - uses an Input Object for the mutations see: http://graphql-ruby.org/mutations/mutation_classes.html see: http://graphql-ruby.org/type_definitions/input_objects.html#customizing-input-objects
hpjaj
force-pushed
the
15-graphql-ruby-server
branch
2 times, most recently
from
October 16, 2018 22:47
2ce5b90
to
5d181bf
Compare
hpjaj
force-pushed
the
15-graphql-ruby-server
branch
from
October 16, 2018 22:48
5d181bf
to
377b553
Compare
hpjaj
force-pushed
the
15-graphql-ruby-server
branch
from
October 17, 2018 14:56
992b0ee
to
2eb452a
Compare
* adds a small task and test to update schema * adds graphql schema * tabs * formatting
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Background
Once we have started saving all of the GitHub and JIRA data in our database, we will want to offer up that data to our FE through a GraphQL server.
The primary resource for this server implementation was GraphQL Ruby.
Associated Issue
#15
Definition of Done
GithubUser
Organization
Repository
Statistic
User
GithubUser
Organization
Repository
Statistic
User
create
mutation forStatistic
update
mutation forStatistic