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

[Bug?]: GraphiQL headers is not working #6894

Closed
1 task done
zaiyou12 opened this issue Nov 14, 2022 · 2 comments · Fixed by #6969
Closed
1 task done

[Bug?]: GraphiQL headers is not working #6894

zaiyou12 opened this issue Nov 14, 2022 · 2 comments · Fixed by #6969
Assignees
Labels
bug/needs-info More information is needed for reproduction

Comments

@zaiyou12
Copy link
Contributor

What's not working?

Following the setup graphiQL headers in official document, but it doesn't work in local. DbAuth all works fine in local and production, only graphiql (Redwood graphql playground) doesn't work.

Screenshot 2022-11-14 at 9 45 56 PM

Here is the log in context:

api | 21:44:52 🌲 incoming request POST xxx /graphql
api | 21:44:52 🐛 Parsing request to extract GraphQL parameters
api | 21:44:52 🌲 request completed 29ms
api | 21:44:52 🐛 Processing GraphQL Parameters
api | 21:44:52 🚨 graphql-server Error building context. Error: Exception in getAuthenticationContext: Cannot read properties of undefined (reading 'id')

How do we reproduce the bug?

  1. Follow dbAuth document
  2. Setup GraphiQL header
  3. Open http://localhost:8911/graphql in browser
yarn redwood setup auth dbAuth

## Set up user and userCredentials...

yarn redwood setup graphiql dbAuth

yarn rw dev

What's your environment? (If it applies)

System:
    OS: macOS 13.0.1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.1 - /private/var/folders/g5/gjrvbjr91g37mz5qzbnxncpr0000gn/T/xfs-0896ea29/node
    Yarn: 3.2.1 - /private/var/folders/g5/gjrvbjr91g37mz5qzbnxncpr0000gn/T/xfs-0896ea29/yarn
  Databases:
    SQLite: 3.39.4 - /usr/bin/sqlite3
  Browsers:
    Chrome: 107.0.5304.110
    Safari: 16.1
  npmPackages:
    @redwoodjs/core: ^3.2.0 => 3.2.0

Are you interested in working on this?

  • I'm interested in working on this
@zaiyou12 zaiyou12 added the bug/needs-info More information is needed for reproduction label Nov 14, 2022
zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 14, 2022
zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 14, 2022
@dthyresson dthyresson self-assigned this Nov 15, 2022
@dthyresson
Copy link
Contributor

Hi @zaiyou12 ...

Did you

yarn redwood setup graphiql dbAuth --view --id <yourid>

as per the docs:

Unique id to identify current user (required only for DBAuth)`

?

@zaiyou12
Copy link
Contributor Author

Hi @dthyresson ,

Yes, I ran the script as the docs and the request headers on the screenshot was generated.

Below is the actual script that I ran and the header generated from the script.

yarn redwood setup graphiql dbAuth --view --id 3
{
  "auth-provider": "dbAuth",
  "cookie": "session=U2Fs...",
  "authorization": "Bearer 3"
}

zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 15, 2022
@dthyresson dthyresson linked a pull request Nov 16, 2022 that will close this issue
zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 16, 2022
zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 17, 2022
zaiyou12 added a commit to zaiyou12/redwood that referenced this issue Nov 22, 2022
@dthyresson dthyresson linked a pull request Nov 28, 2022 that will close this issue
dthyresson added a commit that referenced this issue Nov 28, 2022
Co-authored-by: Aaron So <zaiyou12@gmail.com>
dac09 added a commit that referenced this issue Nov 29, 2022
…xperimental-vite-optin

* 'main' of github.com:redwoodjs/redwood:
  fix(deps): update dependency css-loader to v6.7.2 (#6976)
  auth0 and netlify auth packages (#6922)
  fix(deps): update graphqlcodegenerator monorepo (#6980)
  fix(deps): update dependency react-hook-form to v7.39.7 (#6978)
  fix(deps): update dependency fastify-raw-body to v4.1.3 (#6977)
  chore(deps): update dependency esbuild to v0.15.16 (#6975)
  chore(deps): update babel monorepo (#6974)
  Make it clearer that can use directiveArgs in transformer directive (#6497)
  docs: Adds Troubleshooting Section to Serverless (#6498)
  fix: extractCookie from GraphiQLHeader (#6894) (#6969)
  Render Deploy: Define plan in template (#6905)
  fix launch.json (#6972)
  small tweak to flightcontrol deploy docs (#6973)
jtoar pushed a commit that referenced this issue Dec 8, 2022
Co-authored-by: Aaron So <zaiyou12@gmail.com>
jtoar pushed a commit that referenced this issue Dec 10, 2022
Co-authored-by: Aaron So <zaiyou12@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
Status: Done
2 participants