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

GraphQL Fragment Support #460

Open
offero opened this issue Dec 16, 2019 · 2 comments
Open

GraphQL Fragment Support #460

offero opened this issue Dec 16, 2019 · 2 comments

Comments

@offero
Copy link

offero commented Dec 16, 2019

I like being able to send graphql queries with rest client, but it doesn't seem to support queries with fragments.

Example here: https://www.apollographql.com/docs/react/data/fragments/

Relates to: #127

@hashinclude72
Copy link

is anyone working on it??

@tyron
Copy link

tyron commented Nov 27, 2022

From what I tested, it already works. You just CANNOT have any empty lines between your query and fragments.

So this below should work...

POST https://api.github.com/graphql
Content-Type: application/json
Authorization: Bearer xxx
X-REQUEST-TYPE: GraphQL

query ($name: String!, $owner: String!) {
  repository(name: $name, owner: $owner) {
    ...RepoParts
    stargazers(first: 5) {
        totalCount
        nodes {
            login
            name
        }
    }
    watchers {
        totalCount
    }
  }
}
fragment RepoParts on repository {
    name
    fullName: nameWithOwner
    description
    diskUsage
    forkCount
}

{
    "name": "vscode-restclient",
    "owner": "Huachao"
}

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

No branches or pull requests

4 participants