Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Conversation

@punchcafe
Copy link

@punchcafe punchcafe commented Feb 14, 2020

Motivation

This PR is to meet a need discovered recently while writing tens of tests using the same return types, and discovering that the GraphQLTestTemplate doesn't support querying with fragments (or at least not obviously):
For example, given the following graphqls query resource files:

  • some-fragment.graphqls
  • some-query-using-fragment.graphqls

graphQLTestTemplate.postForResource('graphql/some-query-using-fragment.graphqls') will fail.

Proposed Solution

This PR adds overloaded methods to GraphQLTestTemplate#postForResource and GraphQLTestTemplate#perform, so that the above scenario can be handled with:

graphQLTestTemplate.postForResource(
          'graphql/some-query-using-fragment.graphqls', 
          List.of(some-fragment.graphqls)
)

And can be applied to an arbitrary number of fragments.

@punchcafe punchcafe requested a review from oliemansm February 14, 2020 12:05
Copy link
Member

@oliemansm oliemansm left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@oliemansm oliemansm merged commit 4c7cdba into graphql-java-kickstart:master Feb 19, 2020
@oliemansm oliemansm added this to the 7.0.0 milestone Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants