Skip to content

Add a fetcher prop#22

Open
alanpoulain wants to merge 1 commit into
OneGraph:masterfrom
alanpoulain:add-fetcher-prop
Open

Add a fetcher prop#22
alanpoulain wants to merge 1 commit into
OneGraph:masterfrom
alanpoulain:add-fetcher-prop

Conversation

@alanpoulain

Copy link
Copy Markdown

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

@sgrove

sgrove commented Sep 3, 2019

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
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