Account Queries
River Marks edited this page Jul 1, 2020
·
5 revisions
type Account {
_id: ID
userName: String
name: String
email: String
friends: [ ID ]
}
type Query {
login(userName: String!, password: String!): Account
}
In base GraphQL:
query {
login(userName: "user", password: "password") {
_id
name
userName
email
friends {
_id
}
}
}
What the return looks like:
{
"data": {
"login": {
"_id": "000000000000000000000000",
"name": "John Smith",
"userName": "jsmith",
"email": "jsmith@test.com",
"friends": [
"000000000000000000000001",
"000000000000000000000002"
]
}
}
}