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

Add a fetcher prop #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alanpoulain
Copy link

Like GraphiQL, we should be able to give the fetcher instead of the schema.

@sgrove
Copy link
Contributor

sgrove commented Sep 3, 2019

@alanpoulain This seems like a decent idea, but want to make sure I understand the use-case.

Is this for people using graphiql-explorer outside of GraphiQL?

@alanpoulain
Copy link
Author

No, it's not. It allows to avoid to write this:

    fetcher({
      query: getIntrospectionQuery()
    }).then(result => {
      this.setState({ schema: buildClientSchema(result.data) });
    });
  }

This can be useful in some situations (for instance in this PR api-platform/core#2951, we cannot use the graphql package).

@alanpoulain
Copy link
Author

It has been rebased.

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

Successfully merging this pull request may close these issues.

2 participants