41 lines
561 B
GraphQL
41 lines
561 B
GraphQL
scalar Void
|
|
|
|
type Query {
|
|
booksMany: [Book!]!
|
|
bookOne(id: ID!): Book!
|
|
}
|
|
|
|
type Mutation {
|
|
login(input: LoginInput!): Session!
|
|
register(input: RegisterInput!): Void!
|
|
}
|
|
|
|
input LoginInput {
|
|
email: String!
|
|
password: String!
|
|
}
|
|
|
|
input RegisterInput {
|
|
email: String!
|
|
username: String!
|
|
password: String!
|
|
}
|
|
|
|
type Session {
|
|
accessToken: String!
|
|
refreshToken: RefreshToken!
|
|
}
|
|
|
|
type RefreshToken {
|
|
token: String!
|
|
maxAge: Int!
|
|
secure: Boolean!
|
|
httpOnly: Boolean!
|
|
sameSite: String!
|
|
}
|
|
|
|
type Book {
|
|
id: ID!
|
|
title: String!
|
|
author: String!
|
|
}
|