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

makeRemoteExecutableSchema isn't behaving like the docs #891

Closed
lucasavila00 opened this issue Jul 17, 2018 · 2 comments
Closed

makeRemoteExecutableSchema isn't behaving like the docs #891

lucasavila00 opened this issue Jul 17, 2018 · 2 comments
Labels
blocking Prevents production or dev due to perf, bug, build error, etc.. docs Focuses on documentation changes good first issue has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository

Comments

@lucasavila00
Copy link

As kind of reported on #798 when building a custom fetcher the behavior isn't like in the docs.
Currently the docs seem to assume that the query is a string, when it is in fact a DocumentNode.
The typescript types are correct, by the way.

A workaround is to print the document node before calling your custom fetcher.

This is the affected part of the docs

captura de tela 2018-07-17 as 00 30 05

Using the workaround we'd get:

...
import { print } from "graphql/language/printer";
...
        body: JSON.stringify({ query: print(query), variables, operationName })

I'm using the latest version (3.0.5).
As I'm confused about the correct behavior I won't submit a PR.
I'm waiting to check with you if the docs are mistaken of the implementation is wrong.
Thanks!

@ghost ghost added blocking Prevents production or dev due to perf, bug, build error, etc.. docs Focuses on documentation changes good first issue has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository labels Jul 17, 2018
@wansj
Copy link

wansj commented Jul 28, 2018

I have this problem too. It seems that the document is outdated.Thanks for your workaround.

@hwillson
Copy link
Contributor

hwillson commented Sep 7, 2018

This was addressed by #933. Thanks!

@hwillson hwillson closed this as completed Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking Prevents production or dev due to perf, bug, build error, etc.. docs Focuses on documentation changes good first issue has-reproduction ❤ Has a reproduction in a codesandbox or single minimal repository
Projects
None yet
Development

No branches or pull requests

3 participants