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

support fragment? #8

Open
yuu2lee4 opened this issue May 17, 2018 · 3 comments
Open

support fragment? #8

yuu2lee4 opened this issue May 17, 2018 · 3 comments

Comments

@yuu2lee4
Copy link

support fragment?

@Ayc0
Copy link

Ayc0 commented Aug 13, 2018

If the fragment is within the query, it should work

@lunchboxer
Copy link

Using the template string variable expansion doesn't work with nanographql

export const GET_LESSONS = gql`
  query {
    lessons {
      ...LessonFields
    }
  }
${LessonFields}`

The above leads to a query with nothing where the fragment should be.

@LeviSchuck
Copy link

It is being treated as a tagged template literal, but it is not coded to handle parameters like that.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Instead you can do below, evaluate it before it goes to the function

gql(`query .... ${fragment}`)

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

4 participants