A simple User schema which expects a sub claim inside the token payload can be this one:
type User @auth(
query: {
rule: """
query ($sub: String!){
queryUser(filter: {id: {eq: $sub}}){
id
email
name
gender
birthdate
}
}
"""
}
){
id: String! @search(by: [hash]) @id
email: String! @search(by: [fulltext])
gender: String!
age: String!
name: String!
}
Using an external authority for user authentification, we may provide the following comment on the end of the <schema>.graphql file, including the JWTURL:
Yes, I did that. As far as I know, the URL is good, it is from AWS Cognito itself, which can be obtained by going to: https://cognito-idp.<zone>.amazonaws.com/<client_id>/.well-known/jwks.json.
First, I was using JWTURL when it should be JWKURL.
Second, inside the Audience Key, inside the list, all its members must be inside "". Which, was not.
Since the visual studio graphql extension highlight treats everything as a comment after # (because it is), it does a terrible job a debbuging it.