From 96da991efdc3389f768b08698f3a69a6fbc4d62e Mon Sep 17 00:00:00 2001 From: Prince Muel Date: Fri, 28 Apr 2023 00:37:53 +0100 Subject: [PATCH] chore: remove unnecessary files References #48 Signed-off-by: Prince Muel --- lib/schema/schema.gql | 240 ------------------------ lib/schema/types.d.ts | 413 ------------------------------------------ 2 files changed, 653 deletions(-) delete mode 100644 lib/schema/schema.gql delete mode 100644 lib/schema/types.d.ts diff --git a/lib/schema/schema.gql b/lib/schema/schema.gql deleted file mode 100644 index 0a25e7c..0000000 --- a/lib/schema/schema.gql +++ /dev/null @@ -1,240 +0,0 @@ -### This file was generated by Nexus Schema -### Do not make changes to this file directly - - -""" -The address object used for both the client and sender's address information. It contains the person's street, city, post code and country data -""" -type Address { - """The city where the person lives in""" - city: String! - - """The country where the person is located""" - country: String! - - """The post code of the person's state""" - postCode: String! - - """The street where the person resides""" - street: String! -} - -input AddressInput { - """The city where the person lives in""" - city: String! - - """The country where the person is located""" - country: String! - - """The post code of the person's state""" - postCode: String! - - """The street where the person resides""" - street: String! -} - -type AuthPayload { - accessToken: String! - user: User! -} - -input CreateInvoiceInput { - clientAddress: AddressInput! - clientEmail: String! - clientName: String! - description: String! - items: [InvoiceItemInput!]! - paymentDue: String! - paymentTerms: Int! - senderAddress: AddressInput! - status: Status! - tag: String! - total: Float! - userId: ID -} - -""" -A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. -""" -scalar DateTime - -""" -The object containing metadata about the invoice e.g. items purchased, when the payment is due, client address information, the current status, et cetera -""" -type Invoice { - """The address of the person receiving the invoice""" - clientAddress: Address - - """The email of the person receiving the invoice""" - clientEmail: String - - """The name of the person receiving the invoice""" - clientName: String - - """The exact time the invoice was created""" - createdAt: DateTime - - """A high level description of the items listed in the invoice""" - description: String - - """Id of the invoice""" - id: ID - - """The items listed in the invoice""" - items: [InvoiceItem!]! - - """When the payment of the items listed in the invoice is due""" - paymentDue: String - - """ - The number of days before an invoice's payment grace period expires. Can be 1, 7, 14 or 30 days - """ - paymentTerms: Int - - """The address of the person sending the invoice""" - senderAddress: Address - - """Current payment status of the items listed in the invoice""" - status: Status - - """Unique id sequence used to tag the invoice""" - tag: String - - """The grand total of the price of the items listed in the invoice""" - total: Float - - """The exact time the invoice was updated""" - updatedAt: DateTime - - """The id of the invoice's owner""" - userId: ID -} - -"""An item listed in the invoice""" -type InvoiceItem { - """The id of this item""" - id: ID - - """The name of this item""" - name: String - - """The price of this item""" - price: Float - - """The amount of this item purchased""" - quantity: Int - - """ - The price of this item multiplied by the total number of this item purchased - """ - total: Float -} - -input InvoiceItemInput { - id: ID! - name: String! - price: Float! - quantity: Int! - total: Float! -} - -input LoginInput { - email: String! - password: String! -} - -type LogoutPayload { - message: String! -} - -type Mutation { - createInvoice(input: CreateInvoiceInput!): Invoice - deleteInvoice(where: UniqueIdInput!): Invoice - login(input: LoginInput!): AuthPayload! - logout: LogoutPayload! - refreshAuth: RefreshPayload - register(input: RegisterInput!): AuthPayload - updateInvoice(input: UpdateInvoiceInput!, where: UniqueIdInput!): Invoice -} - -type Query { - invoice(where: UniqueIdInput!): Invoice - invoices: [Invoice]! -} - -type RefreshPayload { - accessToken: String! -} - -input RegisterInput { - """The reentered password to confirm that the passwords match""" - countersign: String - email: String! - firstName: String! - lastName: String! - - """ - The password of the user. Must match the countersign i.e the reentered password - """ - password: String! -} - -"""The current role of the user""" -enum Role { - ADMIN - USER -} - -"""The current status of the invoice""" -enum Status { - DRAFT - PAID - PENDING -} - -input UniqueIdInput { - id: ID! -} - -input UniqueUserId { - userId: ID! -} - -input UpdateInvoiceInput { - clientAddress: AddressInput! - clientEmail: String! - clientName: String! - description: String! - items: [InvoiceItemInput!]! - paymentDue: String! - paymentTerms: Int! - senderAddress: AddressInput! - status: Status! - total: Float! -} - -type User { - """The exact time the user was created""" - createdAt: DateTime! - - """The password of the user""" - email: String! - - """The first name of the user""" - firstName: String - - """Id of the user""" - id: ID! - - """The last name of the user""" - lastName: String - - """The password of the user""" - password: String - - """The avatar of the user""" - photo: String - - """The exact time the user was updated""" - updatedAt: DateTime -} \ No newline at end of file diff --git a/lib/schema/types.d.ts b/lib/schema/types.d.ts deleted file mode 100644 index 618d51a..0000000 --- a/lib/schema/types.d.ts +++ /dev/null @@ -1,413 +0,0 @@ -/** - * This file was generated by Nexus Schema - * Do not make changes to this file directly - */ - - -import type { Context } from "./../src/lib/context" -import type { core, connectionPluginCore } from "nexus" -declare global { - interface NexusGenCustomInputMethods { - /** - * A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. - */ - datetime(fieldName: FieldName, opts?: core.CommonInputFieldConfig): void // "DateTime"; - } -} -declare global { - interface NexusGenCustomOutputMethods { - /** - * A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. - */ - datetime(fieldName: FieldName, ...opts: core.ScalarOutSpread): void // "DateTime"; - /** - * Adds a Relay-style connection to the type, with numerous options for configuration - * - * @see https://nexusjs.org/docs/plugins/connection - */ - connectionField( - fieldName: FieldName, - config: connectionPluginCore.ConnectionFieldConfig - ): void - } -} - - -declare global { - interface NexusGen extends NexusGenTypes {} -} - -export interface NexusGenInputs { - AddressInput: { // input type - city: string; // String! - country: string; // String! - postCode: string; // String! - street: string; // String! - } - CreateInvoiceInput: { // input type - clientAddress: NexusGenInputs['AddressInput']; // AddressInput! - clientEmail: string; // String! - clientName: string; // String! - description: string; // String! - items: NexusGenInputs['InvoiceItemInput'][]; // [InvoiceItemInput!]! - paymentDue: string; // String! - paymentTerms: number; // Int! - senderAddress: NexusGenInputs['AddressInput']; // AddressInput! - status: NexusGenEnums['Status']; // Status! - tag: string; // String! - total: number; // Float! - userId?: string | null; // ID - } - InvoiceItemInput: { // input type - id: string; // ID! - name: string; // String! - price: number; // Float! - quantity: number; // Int! - total: number; // Float! - } - LoginInput: { // input type - email: string; // String! - password: string; // String! - } - RegisterInput: { // input type - countersign?: string | null; // String - email: string; // String! - firstName: string; // String! - lastName: string; // String! - password: string; // String! - } - UniqueIdInput: { // input type - id: string; // ID! - } - UniqueUserId: { // input type - userId: string; // ID! - } - UpdateInvoiceInput: { // input type - clientAddress: NexusGenInputs['AddressInput']; // AddressInput! - clientEmail: string; // String! - clientName: string; // String! - description: string; // String! - items: NexusGenInputs['InvoiceItemInput'][]; // [InvoiceItemInput!]! - paymentDue: string; // String! - paymentTerms: number; // Int! - senderAddress: NexusGenInputs['AddressInput']; // AddressInput! - status: NexusGenEnums['Status']; // Status! - total: number; // Float! - } -} - -export interface NexusGenEnums { - Role: "ADMIN" | "USER" - Status: "DRAFT" | "PAID" | "PENDING" -} - -export interface NexusGenScalars { - String: string - Int: number - Float: number - Boolean: boolean - ID: string - DateTime: any -} - -export interface NexusGenObjects { - Address: { // root type - city: string; // String! - country: string; // String! - postCode: string; // String! - street: string; // String! - } - AuthPayload: { // root type - accessToken: string; // String! - user: NexusGenRootTypes['User']; // User! - } - Invoice: { // root type - clientAddress?: NexusGenRootTypes['Address'] | null; // Address - clientEmail?: string | null; // String - clientName?: string | null; // String - createdAt?: NexusGenScalars['DateTime'] | null; // DateTime - description?: string | null; // String - id?: string | null; // ID - items: NexusGenRootTypes['InvoiceItem'][]; // [InvoiceItem!]! - paymentDue?: string | null; // String - paymentTerms?: number | null; // Int - senderAddress?: NexusGenRootTypes['Address'] | null; // Address - status?: NexusGenEnums['Status'] | null; // Status - tag?: string | null; // String - total?: number | null; // Float - updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime - userId?: string | null; // ID - } - InvoiceItem: { // root type - id?: string | null; // ID - name?: string | null; // String - price?: number | null; // Float - quantity?: number | null; // Int - total?: number | null; // Float - } - LogoutPayload: { // root type - message: string; // String! - } - Mutation: {}; - Query: {}; - RefreshPayload: { // root type - accessToken: string; // String! - } - User: { // root type - createdAt: NexusGenScalars['DateTime']; // DateTime! - email: string; // String! - firstName?: string | null; // String - id: string; // ID! - lastName?: string | null; // String - password?: string | null; // String - photo?: string | null; // String - updatedAt?: NexusGenScalars['DateTime'] | null; // DateTime - } -} - -export interface NexusGenInterfaces { -} - -export interface NexusGenUnions { -} - -export type NexusGenRootTypes = NexusGenObjects - -export type NexusGenAllTypes = NexusGenRootTypes & NexusGenScalars & NexusGenEnums - -export interface NexusGenFieldTypes { - Address: { // field return type - city: string; // String! - country: string; // String! - postCode: string; // String! - street: string; // String! - } - AuthPayload: { // field return type - accessToken: string; // String! - user: NexusGenRootTypes['User']; // User! - } - Invoice: { // field return type - clientAddress: NexusGenRootTypes['Address'] | null; // Address - clientEmail: string | null; // String - clientName: string | null; // String - createdAt: NexusGenScalars['DateTime'] | null; // DateTime - description: string | null; // String - id: string | null; // ID - items: NexusGenRootTypes['InvoiceItem'][]; // [InvoiceItem!]! - paymentDue: string | null; // String - paymentTerms: number | null; // Int - senderAddress: NexusGenRootTypes['Address'] | null; // Address - status: NexusGenEnums['Status'] | null; // Status - tag: string | null; // String - total: number | null; // Float - updatedAt: NexusGenScalars['DateTime'] | null; // DateTime - userId: string | null; // ID - } - InvoiceItem: { // field return type - id: string | null; // ID - name: string | null; // String - price: number | null; // Float - quantity: number | null; // Int - total: number | null; // Float - } - LogoutPayload: { // field return type - message: string; // String! - } - Mutation: { // field return type - createInvoice: NexusGenRootTypes['Invoice'] | null; // Invoice - deleteInvoice: NexusGenRootTypes['Invoice'] | null; // Invoice - login: NexusGenRootTypes['AuthPayload']; // AuthPayload! - logout: NexusGenRootTypes['LogoutPayload']; // LogoutPayload! - refreshAuth: NexusGenRootTypes['RefreshPayload'] | null; // RefreshPayload - register: NexusGenRootTypes['AuthPayload'] | null; // AuthPayload - updateInvoice: NexusGenRootTypes['Invoice'] | null; // Invoice - } - Query: { // field return type - invoice: NexusGenRootTypes['Invoice'] | null; // Invoice - invoices: Array; // [Invoice]! - } - RefreshPayload: { // field return type - accessToken: string; // String! - } - User: { // field return type - createdAt: NexusGenScalars['DateTime']; // DateTime! - email: string; // String! - firstName: string | null; // String - id: string; // ID! - lastName: string | null; // String - password: string | null; // String - photo: string | null; // String - updatedAt: NexusGenScalars['DateTime'] | null; // DateTime - } -} - -export interface NexusGenFieldTypeNames { - Address: { // field return type name - city: 'String' - country: 'String' - postCode: 'String' - street: 'String' - } - AuthPayload: { // field return type name - accessToken: 'String' - user: 'User' - } - Invoice: { // field return type name - clientAddress: 'Address' - clientEmail: 'String' - clientName: 'String' - createdAt: 'DateTime' - description: 'String' - id: 'ID' - items: 'InvoiceItem' - paymentDue: 'String' - paymentTerms: 'Int' - senderAddress: 'Address' - status: 'Status' - tag: 'String' - total: 'Float' - updatedAt: 'DateTime' - userId: 'ID' - } - InvoiceItem: { // field return type name - id: 'ID' - name: 'String' - price: 'Float' - quantity: 'Int' - total: 'Float' - } - LogoutPayload: { // field return type name - message: 'String' - } - Mutation: { // field return type name - createInvoice: 'Invoice' - deleteInvoice: 'Invoice' - login: 'AuthPayload' - logout: 'LogoutPayload' - refreshAuth: 'RefreshPayload' - register: 'AuthPayload' - updateInvoice: 'Invoice' - } - Query: { // field return type name - invoice: 'Invoice' - invoices: 'Invoice' - } - RefreshPayload: { // field return type name - accessToken: 'String' - } - User: { // field return type name - createdAt: 'DateTime' - email: 'String' - firstName: 'String' - id: 'ID' - lastName: 'String' - password: 'String' - photo: 'String' - updatedAt: 'DateTime' - } -} - -export interface NexusGenArgTypes { - Mutation: { - createInvoice: { // args - input: NexusGenInputs['CreateInvoiceInput']; // CreateInvoiceInput! - } - deleteInvoice: { // args - where: NexusGenInputs['UniqueIdInput']; // UniqueIdInput! - } - login: { // args - input: NexusGenInputs['LoginInput']; // LoginInput! - } - register: { // args - input: NexusGenInputs['RegisterInput']; // RegisterInput! - } - updateInvoice: { // args - input: NexusGenInputs['UpdateInvoiceInput']; // UpdateInvoiceInput! - where: NexusGenInputs['UniqueIdInput']; // UniqueIdInput! - } - } - Query: { - invoice: { // args - where: NexusGenInputs['UniqueIdInput']; // UniqueIdInput! - } - } -} - -export interface NexusGenAbstractTypeMembers { -} - -export interface NexusGenTypeInterfaces { -} - -export type NexusGenObjectNames = keyof NexusGenObjects; - -export type NexusGenInputNames = keyof NexusGenInputs; - -export type NexusGenEnumNames = keyof NexusGenEnums; - -export type NexusGenInterfaceNames = never; - -export type NexusGenScalarNames = keyof NexusGenScalars; - -export type NexusGenUnionNames = never; - -export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never; - -export type NexusGenAbstractsUsingStrategyResolveType = never; - -export type NexusGenFeaturesConfig = { - abstractTypeStrategies: { - isTypeOf: false - resolveType: true - __typename: false - } -} - -export interface NexusGenTypes { - context: Context; - inputTypes: NexusGenInputs; - rootTypes: NexusGenRootTypes; - inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars; - argTypes: NexusGenArgTypes; - fieldTypes: NexusGenFieldTypes; - fieldTypeNames: NexusGenFieldTypeNames; - allTypes: NexusGenAllTypes; - typeInterfaces: NexusGenTypeInterfaces; - objectNames: NexusGenObjectNames; - inputNames: NexusGenInputNames; - enumNames: NexusGenEnumNames; - interfaceNames: NexusGenInterfaceNames; - scalarNames: NexusGenScalarNames; - unionNames: NexusGenUnionNames; - allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames']; - allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames']; - allNamedTypes: NexusGenTypes['allInputTypes'] | NexusGenTypes['allOutputTypes'] - abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames']; - abstractTypeMembers: NexusGenAbstractTypeMembers; - objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf; - abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType; - features: NexusGenFeaturesConfig; -} - - -declare global { - interface NexusGenPluginTypeConfig { - } - interface NexusGenPluginInputTypeConfig { - } - interface NexusGenPluginFieldConfig { - - /** - * The nullability guard can be helpful, but is also a potentially expensive operation for lists. - * We need to iterate the entire list to check for null items to guard against. Set this to true - * to skip the null guard on a specific field if you know there's no potential for unsafe types. - */ - skipNullGuard?: boolean - } - interface NexusGenPluginInputFieldConfig { - } - interface NexusGenPluginSchemaConfig { - } - interface NexusGenPluginArgConfig { - } -} \ No newline at end of file