Skip to content
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

External/Global fragment sources #360

Closed
jasonkuhrt opened this issue Feb 13, 2021 · 3 comments
Closed

External/Global fragment sources #360

jasonkuhrt opened this issue Feb 13, 2021 · 3 comments

Comments

@jasonkuhrt
Copy link

When working with GraphQL Relay they have a system where all components in the app using createContainerFragmen generate graphql fragments for use in a so-called QueryRenderer.

But reference to these fragments is global. See example here:

https://relay.dev/docs/en/quick-start-guide

        query={graphql`
          query ViewerQuery {
            viewer {
              id
              ...TodoList_userTodoData   # <-- global frament here...
            }
          }
        `}
 

How can this be supported?

Also note @acao recently blogged about new support for this in the GraphQL VSCode extension. Could be inspiration.

@Quramy
Copy link
Owner

Quramy commented Feb 15, 2021

Relay has it's own naming convention about importing fragments. https://relay.dev/docs/en/quick-start-guide#using-fragments

As a convention, we name the fragment as '_'

I'm wondering whether I should add Relay specific features.

@jasonkuhrt
Copy link
Author

I'm wondering whether I should add Relay specific features.

That would be pretty amazing :)

@Quramy Quramy mentioned this issue Mar 5, 2024
15 tasks
@Quramy
Copy link
Owner

Quramy commented Mar 15, 2024

Introduce global fragment registry by #1209

@Quramy Quramy closed this as completed Mar 15, 2024
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

No branches or pull requests

2 participants