Hi Leo, thanks for making this guide. However, I'm running into some problems.
When I try to authenticate, I get:
mutation Login {
authenticate(
serviceName: "password"
params: {
user: { email: "address@mail.com" }
password: "superSecurePassword"
}
) {
sessionId
tokens {
accessToken
refreshToken
}
}
}
I get:
"errors": [
{
"message": "Cannot query field \"sessionId\" on type \"AuthenticationResult\". Did you mean to use an inline fragment on \"LoginResult\"?",
mutation Login {
authenticate(
serviceName: "password"
params: {
user: { email: "address@mail.com" }
password: "superSecurePassword"
}
) {
... on LoginResult {
sessionId
tokens {
accessToken
refreshToken
}
}
}
}
"message": "Abstract type AuthenticationResult must resolve to an Object type at runtime for field Mutation.authenticate with value { sessionId: \"5eab74b82e13e6148339bb19\", tokens: { refreshToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1ODgyOTQ4NDAsImV4cCI6MTU4ODg5OTY0MH0.-SpTpEhV1MmXVPXOHjMshZv3NMTW5D6VEsRQblTuwpY\", accessToken: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InRva2VuIjoiOTJhZTdjYzc3ZjVmZGEwZGE3OWNlZmM1MWU0NTQzNTEzZTMwODU4MzZlMjMzMTcyY2VmMmQ3MDU3NDBlZGUwODc1NWE5YTc2NzBlNzRkMjExYmQ1OTkiLCJpc0ltcGVyc29uYXRlZCI6ZmFsc2UsInVzZXJJZCI6IjVlYWIzZjk1MDEwNTA4MTEyYWJjNmRmYyJ9LCJpYXQiOjE1ODgyOTQ4NDAsImV4cCI6MTU4ODMwMDI0MH0.Q6ah_meWhBfckoyoscrMbGUswIidNkxu8laGnjaIDY4\" }, user: { _id: [ObjectID], services: [Object], createdAt: 1588281237980, updatedAt: 1588281237980, username: \"whogivesajack\", emails: [Array], id: \"5eab3f95010508112abc6dfc\" } }, received \"undefined\". Either the AuthenticationResult type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function.",
Hi Leo, thanks for making this guide. However, I'm running into some problems.
When I try to authenticate, I get:
Then I tried to form it into inline fragment as suggested here graphql.org/learn/queries/#inline-...
but I am still getting:
Any suggestions?
I think you are using the alpha version of the package which is still WIP (it will bring a new MFA module). Please use the latest stable version :)