Skip to content

Conversation

zhammer
Copy link
Contributor

@zhammer zhammer commented Dec 18, 2018

An empty headers dict currently is not treated as having 'no headers to inject'
Discussed in: #893

Fixes #893 (at least in the case where headers are empty).

Changes proposed in this pull request:

  • Fix logic in checking if headers are empty in INJECT_HEADERS

An empty headers dict currently is not treated as having 'no headers to inject'
Discussed in: graphql#893
@CLAassistant
Copy link

CLAassistant commented Dec 18, 2018

CLA assistant check
All committers have signed the CLA.

@zhammer
Copy link
Contributor Author

zhammer commented Dec 18, 2018

headers can be any in props:
https://github.com/prisma/graphql-playground/blob/master/packages/graphql-playground-react/src/components/Playground.tsx#L85

but are typed as strings in the injectheaders prop:
https://github.com/prisma/graphql-playground/blob/master/packages/graphql-playground-react/src/components/Playground.tsx#L102

and (as far as i can tell in my local use) are sent as an object, which when empty is still considered to have headers to inject

@huv1k
Copy link
Collaborator

huv1k commented Jan 14, 2019

@zhammer Thanks for your PR! It will be in the next version of playground.

@huv1k huv1k merged commit 7c243de into graphql:master Jan 14, 2019
@zhammer zhammer deleted the patch-1 branch January 14, 2019 20:29
RenovZ pushed a commit to RenovZ/graphql-playground that referenced this pull request Mar 25, 2022
* Update headers are empty check on INJECT_HEADERS

An empty headers dict currently is not treated as having 'no headers to inject'
Discussed in: graphql#893

* Accidentally changed line
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.

3 participants