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

feat: add GenerateGraphiQLHeaders as new param in createGraphQLHandler #5512

Merged

Conversation

alicelovescake
Copy link
Contributor

@netlify
Copy link

netlify bot commented May 11, 2022

Deploy Preview for redwoodjs-docs ready!

Name Link
🔨 Latest commit dfa84b8
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/62c2c4d3043e410008771ba9
😎 Deploy Preview https://deploy-preview-5512--redwoodjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@alicelovescake alicelovescake requested a review from dthyresson May 11, 2022 17:35
@jtoar jtoar added the release:feature This PR introduces a new feature label May 12, 2022
@dthyresson
Copy link
Contributor

I also noticed this issue which could be related?

dotansimha/graphql-yoga#1163

Copy link
Contributor

@dthyresson dthyresson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll pair soon to go over how we might mock the credentials per auth provider

packages/graphql-server/src/functions/types.ts Outdated Show resolved Hide resolved
@alicelovescake alicelovescake marked this pull request as draft May 12, 2022 21:58
@alicelovescake alicelovescake force-pushed the feat/auth-headers-gql-playground branch from 01dd7d3 to eded49e Compare May 30, 2022 01:16
@dthyresson dthyresson removed their assignment Jun 7, 2022
@dthyresson dthyresson marked this pull request as ready for review July 3, 2022 21:06
@dthyresson dthyresson self-requested a review July 3, 2022 21:07
@dthyresson
Copy link
Contributor

@alicelovescake I tried to resolve conflicts and gets tests to pass. Can your review so we can merge?

Note: I had to add a null check the in the shared code for dbAuth when checking cookies.

Copy link
Contributor Author

@alicelovescake alicelovescake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dthyresson Good catch on the checking for null case when checking the session cookie. I just changed the cookie from graphiql header to return undefined so we don't have to do the extra null check. Otherwise, I think we are good to merge

const cookieFromGraphiqlHeader =
    process.env.NODE_ENV === 'development'
      ? JSON.parse(event.body ?? '{}').extensions.headers.cookie
      : undefined

@dthyresson dthyresson enabled auto-merge (squash) July 4, 2022 00:39
@dthyresson dthyresson disabled auto-merge July 4, 2022 00:43
@alicelovescake
Copy link
Contributor Author

@dthyresson made some minor fixes to get the tests passing. I don't have write access so if you think it looks good, you can merge!

@dthyresson dthyresson enabled auto-merge (squash) July 4, 2022 10:46
@dthyresson dthyresson merged commit a613e56 into redwoodjs:main Jul 4, 2022
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Jul 4, 2022
@jtoar jtoar modified the milestones: next-release, v2.1.0 Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
Status: Archived
Development

Successfully merging this pull request may close these issues.

RFC: Improve GraphQL DX by setting authentication headers in GraphiQL
4 participants