evyos-frontend-development/oldgraphql/schema/userTypeDefs.ts

76 lines
1.7 KiB
TypeScript

import { gql } from "graphql-tag";
export const userTypeDefs = gql`
"""Represents a single token entry with a prefix and value"""
type CollectionTokenItem {
prefix: String!
token: String!
}
"""Represents the collection of tokens assigned to a user"""
type CollectionToken {
tokens: [CollectionTokenItem!]!
default: String!
}
type Person {
_id: ID!
firstName: String!
surname: String!
middleName: String!
}
"""User model with references and metadata"""
type User {
_id: ID
uuid: String!
expiresAt: String
resetToken: String
password: String!
history: [String!]
tag: String!
email: String!
phone: String!
collectionTokens: CollectionToken!
person: Person!
type: ID
createdAt: String
updatedAt: String
}
"""Input type for a single token entry"""
input CollectionTokenItemInput {
prefix: String!
token: String!
}
"""Input type for a user's token collection"""
input CollectionTokenInput {
tokens: [CollectionTokenItemInput!]!
default: String!
}
"""Input for creating a new user"""
input CreateUserInput {
password: String!
history: [String!]
tag: String!
email: String!
phone: String!
collectionTokens: CollectionTokenInput!
person: ID!
type: ID
}
"""Queries"""
type Query {
users: [User!]!
user(id: ID!): User
}
"""Mutations"""
type Mutation {
createUser(input: CreateUserInput!): User!
}
`;