1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Basic current session/user query + user emails connection

This commit is contained in:
Quentin Gliech
2022-11-07 18:34:11 +01:00
parent ea1ecd5fc6
commit ac40367c5f
7 changed files with 453 additions and 10 deletions

View File

@ -1,3 +1,22 @@
type Authentication {
id: ID!
createdAt: DateTime!
}
type BrowserSession {
id: ID!
user: User!
lastAuthentication: Authentication
createdAt: DateTime!
}
"""
Implement the DateTime<Utc> scalar
The input/output is a string in RFC3339 format.
"""
scalar DateTime
@ -9,11 +28,31 @@ type Mutation {
hello: Boolean!
}
"""
Information about pagination in a connection
"""
type PageInfo {
"""
When paginating backwards, are there more items?
"""
hasPreviousPage: Boolean!
"""
When paginating forwards, are there more items?
"""
hasNextPage: Boolean!
"""
When paginating backwards, the cursor to continue.
"""
startCursor: String
"""
When paginating forwards, the cursor to continue.
"""
endCursor: String
}
type Query {
"""
A simple property which uses the DB pool and the current session
"""
username: String
currentSession: BrowserSession
currentUser: User
}
@ -24,6 +63,50 @@ type Subscription {
integers(step: Int! = 1): Int!
}
type User {
id: ID!
username: String!
primaryEmail: UserEmail
emails(after: String, before: String, first: Int, last: Int): UserEmailConnection!
}
type UserEmail {
id: ID!
email: String!
createdAt: DateTime!
confirmedAt: DateTime
}
type UserEmailConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [UserEmailEdge!]!
"""
A list of nodes.
"""
nodes: [UserEmail!]!
totalCount: Int!
}
"""
An edge in a connection.
"""
type UserEmailEdge {
"""
A cursor for use in pagination
"""
cursor: String!
"""
The item at the end of the edge
"""
node: UserEmail!
}
schema {
query: Query
mutation: Mutation