<@U0RQY0KK5>, I want to use Auth0 for login ans si...
# prisma-whats-new
p
@nilan, I want to use Auth0 for login ans signup How can i login and signup from the playground? there any mutation call back for the createUser with Auth0?
n
@ppatidar to create a user with the Auth0 integration, you need a valid JWT that corresponds to that user
you can obtain it using Auth0 Lock for example
p
mutation { createInstitute( country: "India" name: "My Sports" typeOfInstitute: "Training Center" status: ACTIVE owner: { authProvider: { auth0: { idToken:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2F0aGxpY2hlLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1OTE5YTM4OGNhZmQyOTFkZDA5YzM5ZGMiLCJhdWQiOiJ6UmgwcFhRRVI1MXJGWllpM3JyVTJIb1FnWWVVMkJZSyIsImV4cCI6MTQ5NDg4ODQ5MSwiaWF0IjoxNDk0ODUyNDkxfQ.j-xDGy-F7X84nfI5aChV3KILEFyted0ItBRTEcv-jss" } } email: "institute@miniche.com" firstName: "Institute" lastName: "Institute" mobileNumber: "1234567890" role: OWNER dob: "2015-11-22T135731.123Z" } ){ id } }
type Institute implements Node { coache: [Coache!]! @relation(name: "CoacheOnInstitute") country: String createdAt: DateTime! id: ID! @isUnique instituteSport: [InstituteSport!]! @relation(name: "InstituteSportOnInstitute") manager: [Manager!]! @relation(name: "ManagerOnInstitute") name: String! owner: User! @relation(name: "InstituteOnUser") status: InstituteStatus! typeOfInstitute: String updatedAt: DateTime! }
I'm getting error like this: Unknown argument 'owner' on field 'createInstitute' of type 'Mutation'. Did you mean 'ownerId'? (line 7, column 5):\n\t \towner: {\n ^",
Please let me know what is the wrong in this?
n
to signup a new user you need to use
createUser
p
Can you check my mutation call and let me know where i need to correct?
n
you can't use
owner
argument because it would create a user
but you can only create users with
createUser
mutation
instead of
createInstitute
, run
createUser
p
only i need to change createInstitute in my query? everything will same? I'm not sure about this
n
no, you need to adjust accordingly 🙂
p
I just want to create institute with institute owner i want to user both in one query? can you provide me same example how can create two object in one query?
i'm not getting how i can do
Any way to do this?
n
createUser( <all fields currently inside your owner field>, institute: {<all fields currently inside your createInstitute mutation>})
p
Ok I'll try this
Thanks
This is working good