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

Unknown type "AuthChallengeInput" #12

Open
kf106 opened this issue Dec 7, 2022 · 2 comments
Open

Unknown type "AuthChallengeInput" #12

kf106 opened this issue Dec 7, 2022 · 2 comments

Comments

@kf106
Copy link

kf106 commented Dec 7, 2022

I'm getting an error in the client, "Error @oneclickdapp/ethereum-auth login(): Error: Couldn't get auth challenge from your server. See above error for more details" which I presume is because of the following error on the server:

api | 12:08:58 🚨 graphql-server Unknown type "AuthChallengeInput".
api | 12:08:58 🚨 graphql-server Cannot query field "authChallenge" on type "Mutation".

I can see that ethereumAuth.js is supposed to provide the challenge, but I'm guessing something isn't updated in the gql types, or isn't set up properly, when following the README.md.

@pi0neerpat
Copy link
Contributor

pi0neerpat commented Dec 9, 2022

Do you have this in your sdl?

It might need to be changed from 'input' to 'type'

@wispyco
Copy link

wispyco commented Jan 8, 2023

I think this sdl may not be correct.

https://github.com/oneclickdapp/ethereum-auth/blob/master/examples/eth-auth-demo/api/src/graphql/authDetails.sdl.js

I combined the one you linked with this one to get this and it did work

export const schema = gql`
  type AuthDetail {
    id: String!
    nonce: String!
    timestamp: DateTime!
    User: User
  }
  type Query {
    authDetails: [AuthDetail!]! @skipAuth
  }
  input CreateAuthDetailInput {
    nonce: String!
    timestamp: DateTime!
  }
  input UpdateAuthDetailInput {
    nonce: String
    timestamp: DateTime
  }
  type AuthChallengeResult {
    message: String!
  }
  type AuthVerifyResult {
    token: String!
  }
  input AuthChallengeInput {
    address: String!
    options: JSON
  }
  input AuthVerifyInput {
    signature: String!
    address: String!
    options: JSON
  }

  type Mutation {
    authChallenge(input: AuthChallengeInput!): AuthChallengeResult @skipAuth
    authVerify(input: AuthVerifyInput!): AuthVerifyResult @skipAuth
  }
`

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

No branches or pull requests

3 participants