-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQlTester should support fragments #923
Comments
@thomascaillier Interesting. Can you edit your issue to describe an example of the actual content of those Do you have an example of this feature being supported by other tools and libraries? Creating our own templating engine for that asks the question of IDE support... |
@bclozel issue updated 👍 I know IntelliJ doesn't need any import, it seems it analyze the whole folder. The |
Thanks for the update @thomascaillier We looked into this and came to the conclusion that graphql-tools/graphql-utilities are the only solutions out there for this, and they're not just about concatenating pieces of schema, but really a complete namespace and import system that parses the schema elements and allows to rename types on-the-fly (a bit like TypeScript imports). So this not only applies to testing, but also to schemas in general. We don't think we can achieve simply this level of support as this is very much tied to the TypeScript/JavaScript ecosystem. What we could do instead is the following: offer If we're looking into a more complete and general solution for this, I think this should be discussed at the level of the graphql-java project - we're using its |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Problem
I have several mutations and queries that returns the same type, so I use a fragment to define and reuse it.
I want to test those mutations and queries using a
GraphQlTester
(more precisely aHttpGraphQlTester
).Let's assume I have mutation A and mutation B that are both using a fragment in
fragment.graphql
:src └─ main └─ resources └─ graphql └─ definitions.graphqls └─ test └─ resources └─ graphql-test └─ mutationA.graphql └─ mutationB.graphql └─ fragment.graphql
definitions.graphqls :
mutationA.graphql :
mutationB.graphql :
fragments.graphql :
When I run a test like this :
Solutions
The solutions I see are either support an import syntax (ex:
#import "fragments.sql"
) or taking the wholegraphql-test
folder as contextThe text was updated successfully, but these errors were encountered: