Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

feat: add fragments server side #575

Open
Ariel-Dayan opened this issue Nov 26, 2019 · 2 comments · May be fixed by #576
Open

feat: add fragments server side #575

Ariel-Dayan opened this issue Nov 26, 2019 · 2 comments · May be fixed by #576

Comments

@Ariel-Dayan
Copy link

Ariel-Dayan commented Nov 26, 2019

Allow clients that send queries to use predefined fragments on the server side.
The goal:

  1. Shorten the query for every client by avoiding to repeat the fragment declaration.
  2. Allow the client to have dynamic fragments that are updated server side. For example, if a field was added to the schema server side, the fragment will update accordingly.
Ariel-Dayan added a commit to Ariel-Dayan/express-graphql that referenced this issue Nov 28, 2019
added function addedServerFragments that concats relevent
fragments from the server to req query.
added function findFragments that return relevant fragments
for current request.
added function sliceFirstWord.
added serverFragments option.

resolves graphql#575
@acao
Copy link
Member

acao commented Dec 9, 2019

to follow conventions elsewhere, we might accomplish this via graphql-config where folks are already using similar capability for IDE tooling? but it should also be possible without graphql-config

@acao
Copy link
Member

acao commented Dec 9, 2019

@Urigo what do you think about graphql-config plus express-graphql? I know we've been mostly focused on this for dev tooling

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants