-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fragment referencing/Query composition support #343
Conversation
60d5d04
to
8f38485
Compare
@@ -202,7 +204,7 @@ export class QueryManager { | |||
mutation: Document, | |||
variables?: Object, | |||
resultBehaviors?: MutationBehavior[], | |||
}): Promise<GraphQLResult> { | |||
}, fragments: FragmentDefinition[] = []): Promise<GraphQLResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just add this to the existing list of options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds better - will do.
@Poincare one question I just realized - how will this work with the view integrations? Perhaps it should be a static export of Like: import { createFragments } from 'apollo-client';
createFragments(gql`
...
`); Or something. @jbaxleyiii do you have any thoughts on how this might or should interact with |
I thought the Secondly, I think holding the state that describes the fragment names should be specific to a particular instance of (P.S. Moved |
502b561
to
f7e8d16
Compare
|
||
// This function disables the warnings printed about fragment names. One place where this chould be | ||
// is called when writing unit tests that depend on Apollo Client and use named fragments that may | ||
// have the Nsame name across different unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra capital N
Looks great other than some small comments |
Fixed @stubailo |
…a method to ApolloClient to construct fragments
…for fragment referencing
…nting where they were not supposed to
c6ad8db
to
fa22a34
Compare
Adding a way to reference fragments from different components of your application and compose queries using those fragments. See #338
TODO: