Skip to content

Improve Helpers::Graphql.execute_query spec helper#51

Merged
AlessioRocco merged 5 commits intomasterfrom
improve-execute_query-spec-helper
Dec 6, 2019
Merged

Improve Helpers::Graphql.execute_query spec helper#51
AlessioRocco merged 5 commits intomasterfrom
improve-execute_query-spec-helper

Conversation

@AlessioRocco
Copy link
Copy Markdown
Contributor

@AlessioRocco AlessioRocco commented Nov 29, 2019

Enhance the Helpers::Graphql.execute_query with:

  • Moves the queries under spec/support
  • Adds "variables " option to the query
  • Adds an option to decode the query result ids
  • Adds the ability to choose the format of the query result

@AlessioRocco AlessioRocco self-assigned this Nov 29, 2019
@AlessioRocco AlessioRocco force-pushed the improve-execute_query-spec-helper branch 3 times, most recently from c6be99a to aa105d7 Compare November 29, 2019 11:08
@AlessioRocco AlessioRocco marked this pull request as ready for review November 29, 2019 12:35
@AlessioRocco AlessioRocco force-pushed the improve-execute_query-spec-helper branch from aa105d7 to 4f91cbb Compare November 29, 2019 12:36
@AlessioRocco AlessioRocco force-pushed the improve-execute_query-spec-helper branch 4 times, most recently from c453824 to 293a118 Compare December 6, 2019 07:10
Leave it under the spec root folder caused some misunderstanding on the
purpose of these graphql queries.
This allows using variables with our graphql spec queries.

Add it also to the 'query is successful' shared example.
This transforms all the result query ids from the UUID to the Rails
model id and allows the specs to compare the ids directly without
the need to convert it every time.
It manage how the query response is parsed and it's OpenStruct by default.
@AlessioRocco AlessioRocco force-pushed the improve-execute_query-spec-helper branch from 293a118 to d7f543a Compare December 6, 2019 08:00
@AlessioRocco AlessioRocco force-pushed the improve-execute_query-spec-helper branch from d7f543a to 3f70203 Compare December 6, 2019 10:07
Copy link
Copy Markdown
Contributor

@ChristianRimondi ChristianRimondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AlessioRocco AlessioRocco merged commit a02ed7f into master Dec 6, 2019
@AlessioRocco AlessioRocco deleted the improve-execute_query-spec-helper branch December 6, 2019 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants