Skip to content
Back

Are the GraphQL session docs up to date?

  • 0
  • GraphQL
  • Web
  • Cloud
Criffis
1 May, 2024, 18:44

I am trying to create an emailPassword session with graphql (SSR) and I do not receive a secret. Just an ID

TypeScript
graphql.mutation({
    query: `mutation (
      $email: String!,
      $password: String!,
  ) {
    accountCreateEmailPasswordSession(
      email: $email,
      password: $password,
  ) {
      _id,
      secret
    }
  }`,
    variables: {
      email: fields.email,
      password: fields.password,
    },
  })

This is what I get in the log from the request.

I get an _id but an empty secret

TL;DR
Developers are questioning if the GraphQL session docs are up to date, as there seems to be an issue with the ID and secret correlation. When attempting to set a cookie with the secret and retrieve an account, a permission error occurs. The request for an emailPassword session is returning an empty secret.
Criffis
1 May, 2024, 18:53

To me in the docs it looks like id === secret, but if I use the secret to set a cookie and use this cookie to retrieve an account, I get a permission error, stating that the account is a guest, even though it's using a emailPassword session secret (id?)?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more