Hi guys!! Is it possible to accept GET requests wi...
# prisma-whats-new
i
Hi guys!! Is it possible to accept GET requests with
graphql-yoga
? I want to validate the user's email account through a link inside an email that will communicate with my
GraphQLServer
. Thanks for your help guys!!
m
why don't you do this with graphQL?
I send the user a link my-domain.com/?verificationCode=xxxxxx. they click on it and then apollo-client sends me the verificationCode
@ivan-marquez
i
hi max! the project has the minimum setup with graphql-yoga. Pretty much the setup inside the graphql-yoga readme. Where would I put the GraphQL config?
and thank you for your help!
m
what do you mean by GraphQL config?
l
It's built on express. You can grab it with middleware
i
I mean the schema and resolver to validate the email. Should it be on a separated schema from the one I'm using in graphql-yoga?
l
Oh I see. GraphQL is transport agnostic, so there's no question it's possible, but I think @max has the better idea. Set up a client route. It'll be faster and a better user experience than cobbling multiple graphql endpoints
m
I would add
activateAccount(activationCode: ID!): Boolean!
to
type mutation
but you gonna have to figure some out between
you'll need to add
activateAccount
to
resolvers.Mutations
i
I'm sorry max, it's clear I'm a newbie 😂 how would they reach this mutation from a link inside an email? That's where I'm lost.
m
oh right. Are you using a JS framework?
i
yes. Node
m
use apollo-client
are you using a web frontend JS framework?
i
ok on the client side. I'll have to check since I'm just in the backend. Is it possible with apollo-client?
m
yes it's possible with apollo-client.
They will send you a mutation... something like
Copy code
const activateAccount = gql`
  mutation activateAccount($accountActivationCode: ID!) {
    activateAccount(activationCode: $accountActivationCode)
  }
`
best to have a chat with your frontend person
i
ok I see. Thank you for your help max!!