Skip to content

Finish Chapter 7 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions nexus-typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,23 @@


import type { Context } from "./src/context"


import type { core } from "nexus"
declare global {
interface NexusGenCustomInputMethods<TypeName extends string> {
/**
* 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 extends string>(fieldName: FieldName, opts?: core.CommonInputFieldConfig<TypeName, FieldName>): void // "DateTime";
}
}
declare global {
interface NexusGenCustomOutputMethods<TypeName extends string> {
/**
* 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 extends string>(fieldName: FieldName, ...opts: core.ScalarOutSpread<TypeName, FieldName>): void // "DateTime";
}
}


declare global {
Expand All @@ -25,6 +40,7 @@ export interface NexusGenScalars {
Float: number
Boolean: boolean
ID: string
DateTime: any
}

export interface NexusGenObjects {
Expand All @@ -33,6 +49,7 @@ export interface NexusGenObjects {
user: NexusGenRootTypes['User']; // User!
}
Link: { // root type
createdAt: NexusGenScalars['DateTime']; // DateTime!
description: string; // String!
id: number; // Int!
url: string; // String!
Expand All @@ -44,6 +61,10 @@ export interface NexusGenObjects {
id: number; // Int!
name: string; // String!
}
Vote: { // root type
link: NexusGenRootTypes['Link']; // Link!
user: NexusGenRootTypes['User']; // User!
}
}

export interface NexusGenInterfaces {
Expand All @@ -62,15 +83,18 @@ export interface NexusGenFieldTypes {
user: NexusGenRootTypes['User']; // User!
}
Link: { // field return type
createdAt: NexusGenScalars['DateTime']; // DateTime!
description: string; // String!
id: number; // Int!
postedBy: NexusGenRootTypes['User'] | null; // User
url: string; // String!
voters: NexusGenRootTypes['User'][]; // [User!]!
}
Mutation: { // field return type
login: NexusGenRootTypes['AuthPayload']; // AuthPayload!
post: NexusGenRootTypes['Link']; // Link!
signup: NexusGenRootTypes['AuthPayload']; // AuthPayload!
vote: NexusGenRootTypes['Vote'] | null; // Vote
}
Query: { // field return type
feed: NexusGenRootTypes['Link'][]; // [Link!]!
Expand All @@ -80,6 +104,11 @@ export interface NexusGenFieldTypes {
id: number; // Int!
links: NexusGenRootTypes['Link'][]; // [Link!]!
name: string; // String!
votes: NexusGenRootTypes['Link'][]; // [Link!]!
}
Vote: { // field return type
link: NexusGenRootTypes['Link']; // Link!
user: NexusGenRootTypes['User']; // User!
}
}

Expand All @@ -89,15 +118,18 @@ export interface NexusGenFieldTypeNames {
user: 'User'
}
Link: { // field return type name
createdAt: 'DateTime'
description: 'String'
id: 'Int'
postedBy: 'User'
url: 'String'
voters: 'User'
}
Mutation: { // field return type name
login: 'AuthPayload'
post: 'Link'
signup: 'AuthPayload'
vote: 'Vote'
}
Query: { // field return type name
feed: 'Link'
Expand All @@ -107,6 +139,11 @@ export interface NexusGenFieldTypeNames {
id: 'Int'
links: 'Link'
name: 'String'
votes: 'Link'
}
Vote: { // field return type name
link: 'Link'
user: 'User'
}
}

Expand All @@ -125,6 +162,9 @@ export interface NexusGenArgTypes {
name: string; // String!
password: string; // String!
}
vote: { // args
linkId: number; // Int!
}
}
}

Expand Down
198 changes: 198 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@types/bcryptjs": "~2.4.0",
"@types/express": "^4.17.13",
"@types/express-graphql": "^0.9.0",
"@types/jsonwebtoken": "~8.5.0",
"prettier": "^2.4.1",
"prisma": "^3.5.0",
Expand All @@ -26,6 +27,7 @@
"apollo-server": "^3.5.0",
"bcryptjs": "~2.4.0",
"graphql": "^15.7.2",
"graphql-scalars": "^1.14.1",
"jsonwebtoken": "~8.5.0",
"nexus": "^1.1.0"
},
Expand Down
Binary file modified prisma/dev.db
Binary file not shown.
Loading