Reorganize specs to support GraphQL mutations#73
Merged
AlessioRocco merged 4 commits intomasterfrom Feb 7, 2020
Merged
Conversation
256fea2 to
47ad934
Compare
47ad934 to
0b6700e
Compare
0b6700e to
679cef6
Compare
Replace the constant and the hardcoded paths with RSpec custom settings.
We are going to add the GraphQL mutations and moves the queries and responses under "spec/support/graphql/" will help us to have a better folder structure. Also, the integration specs are moved to "spec/integration/queries/" for the same reason.
It allows executing a mutation from a gql file located in the folder specified by the 'graphql_mutation_folder' RSpec setting by using just its name and returns the result as a Hash by default.
It is of type "graphql_mutation" and can be used in the specs to explain better the result of a Graphql mutation. The "graphql_mutation" sets the subject by default through the "graphql mutation subject" shared context. The subject mutation can be set using a "let(:mutation)" or with the "mutation" metadata, and also the 'context' and 'variables' can be used in the same way.
679cef6 to
74b16f2
Compare
mdesantis
approved these changes
Feb 7, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the RSpec helper methods and reorganize the folders to better interact with the GraphQL mutations.