Passing array of fragments in query fails
See original GitHub issuePassing array of fragments to query fails, e.g.:
query SomeQuery {
field {
someRuntimeGeneratedFieldsOnFragments
}
}
${arrayOfFragments}
with error
Syntax Error GraphQL (25:1) Unexpected [
24: }
25: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
^
26:
It is working as expected when using createFragments
+ fragments
option in apollo-client, which is being deprecated in next version.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Fragments - Apollo GraphQL Docs
A GraphQL fragment is a piece of logic that can be shared between multiple queries and mutations. ... Every fragment includes a subset...
Read more >Use GraphQL to retrieve an object that contains an array of ...
Fragments can be defined inline within a selection set. This is done to conditionally include fields based on their runtime type.
Read more >Querying Postgres Array types with fragment. - Google Groups
I'm trying to query a table with an array type and have been unable to get it to work successfully. The basic setup...
Read more >Pass a list or other type to custom Ecto query - Elixir Forum
A fragment lets you execute a SQL fragment directly into the database, maybe you could try wrapping the jsonb_array_elements function call into ...
Read more >Fragment | Android Developers
Interaction with fragments is done through FragmentManager , which can be ... a string of text based on an index of a string...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
found a way to insert an array of fragments into query by combining them into a single gql-tag:
i think there is some use case for being able to pass both an array of fragments or map whose values are fragments (as those are often how our components are storing references to the fragments), but there hasn’t been so much pain in just being explicit about what fragments are being interpolated. closing this for now.