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

Response must be JSON object, not string #885

Closed
wants to merge 3 commits into from

Conversation

PhilAndrew
Copy link

In azureFunctionsApollo.js line 26:

I had to change from
body: gqlResponse,
to
body: JSON.parse(gqlResponse),

Then it worked correctly. Before this fix the problem was that a string was being returned and not real JSON.

    "apollo-cache-control": "0.0.9",
    "apollo-server-azure-functions": "^1.3.2",
    "apollo-server-core": "^1.3.2",

@apollo-cla
Copy link

@PhilAndrew: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@ross2411
Copy link

ross2411 commented Apr 1, 2018

Please can this PR be approved. Graphiql doesn't appear to work properly without this fix

@abernix
Copy link
Member

abernix commented Apr 17, 2018

Thanks for opening this originally, and sorry we didn't get to this sooner. I've gone ahead and cleaned up and merged #753 which was a different take on this which instead utilizes Azure Functions' isRaw attribute, which should have a performance advantage over using JSON.parse for an object which will ultimately be re-stringified before going over the wire.

(I've posted this similar comment to #823, which was another attempt at the same change.)

@abernix abernix closed this Apr 17, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants