Test examples with CI (#220)
* Update CI config to test examples * Fix star wars example * Update yarn.lock of nexus-prisma example * Fix kitchen-sink example * Update nexus to beta9 in star wars example * Upgrade nexus in ts-ast-reader example * Fix ghost example * Fix githunt-api example * Make githunt-api test pass * Fix nexus-prisma example * Fix typing in ts-ast-reader * Use yarn link when nexus deps is already 0.12.0-beta.9 * Remove yarn link from example_ghost * Make sure generated files are up to date
This commit is contained in:
parent
03da1ffb76
commit
0a77f622e9
|
@ -1,17 +1,99 @@
|
|||
version: 2.1
|
||||
|
||||
jobs:
|
||||
build_lint_test:
|
||||
nexus:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn install
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn build
|
||||
- run: yarn lint
|
||||
- run: yarn test:ci
|
||||
|
||||
example_apollo-fullstack:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn --cwd=examples/apollo-fullstack --frozen-lockfile
|
||||
- run: yarn --cwd=examples/apollo-fullstack tsc
|
||||
|
||||
example_ghost:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn --cwd=examples/ghost --frozen-lockfile
|
||||
- run: yarn --cwd=examples/ghost tsc
|
||||
|
||||
example_githunt-api:
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn link
|
||||
- run: yarn --cwd=examples/githunt-api --frozen-lockfile
|
||||
- run: yarn --cwd=examples/githunt-api link nexus
|
||||
- run: yarn --cwd=examples/githunt-api tsc
|
||||
|
||||
example_kitchen-sink:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn --cwd=examples/kitchen-sink --frozen-lockfile
|
||||
- run: yarn --cwd=examples/kitchen-sink tsc
|
||||
|
||||
example_nexus-prisma:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn --cwd=examples/nexus-prisma --frozen-lockfile
|
||||
- run: yarn --cwd=examples/nexus-prisma tsc
|
||||
|
||||
example_star-wars:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn link
|
||||
- run: yarn --cwd=examples/star-wars --frozen-lockfile
|
||||
- run: yarn --cwd=examples/star-wars link nexus
|
||||
- run: yarn --cwd=examples/star-wars tsc
|
||||
- run:
|
||||
command: |
|
||||
rm examples/star-wars/src/star-wars-typegen.ts
|
||||
rm examples/star-wars/star-wars-schema.graphql
|
||||
node examples/star-wars/dist/schema.js
|
||||
git diff --exit-code
|
||||
|
||||
example_ts-ast-reader:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- run: yarn --frozen-lockfile
|
||||
- run: yarn link
|
||||
- run: yarn --cwd=examples/ts-ast-reader --frozen-lockfile
|
||||
- run: yarn --cwd=examples/ts-ast-reader link nexus
|
||||
- run: yarn --cwd=examples/ts-ast-reader tsc
|
||||
|
||||
workflows:
|
||||
nexus:
|
||||
jobs:
|
||||
- build_lint_test
|
||||
- nexus
|
||||
- example_apollo-fullstack
|
||||
- example_ghost
|
||||
- example_githunt-api
|
||||
- example_kitchen-sink
|
||||
- example_nexus-prisma
|
||||
- example_star-wars
|
||||
- example_ts-ast-reader
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
### This file was autogenerated by GraphQL Nexus
|
||||
### This file was autogenerated by Nexus 0.11.2
|
||||
### Do not make changes to this file directly
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
/**
|
||||
* This file was automatically generated by GraphQL Nexus
|
||||
* This file was automatically generated by Nexus 0.11.2
|
||||
* Do not make changes to this file directly
|
||||
*/
|
||||
|
||||
import * as t from "./typeDefs"
|
||||
|
||||
|
||||
|
||||
|
||||
declare global {
|
||||
interface NexusGen extends NexusGenTypes {}
|
||||
}
|
||||
|
|
|
@ -15,12 +15,18 @@ const schema = makeSchema({
|
|||
types,
|
||||
outputs: {
|
||||
schema: path.join(__dirname, "../fullstack-schema.graphql"),
|
||||
typegen: path.join(__dirname, "../src/fullstack-typegen.ts"),
|
||||
typegen: path.join(
|
||||
__dirname.replace(/\/dist$/, "/src"),
|
||||
"../src/fullstack-typegen.ts"
|
||||
),
|
||||
},
|
||||
typegenAutoConfig: {
|
||||
sources: [
|
||||
{
|
||||
source: path.join(__dirname, "./typeDefs.ts"),
|
||||
source: path.join(
|
||||
__dirname.replace(/\/dist$/, "/src"),
|
||||
"./typeDefs.ts"
|
||||
),
|
||||
alias: "t",
|
||||
},
|
||||
],
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"knex": "^0.16.3",
|
||||
"lodash": "^4.17.11",
|
||||
"mysql": "^2.16.0",
|
||||
"nexus": "0.11.2"
|
||||
"nexus": "0.12.0-beta.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.16.1",
|
||||
|
|
|
@ -4383,10 +4383,10 @@ netjet@1.3.0:
|
|||
lru-cache "^4.0.0"
|
||||
posthtml "^0.9.0"
|
||||
|
||||
nexus@0.11.2:
|
||||
version "0.11.2"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.11.2.tgz#10190c512dc8bdac619e6b3ab43c9f892bfc461b"
|
||||
integrity sha512-hBcMbi0QrYBNAtIuM5ga5PBA2i5y8CXQ18ptc9k8CskOR4EKGC2KM4BG6QrctX80hZIWQXH/8adb9+BvNYOqvw==
|
||||
nexus@0.12.0-beta.9:
|
||||
version "0.12.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.9.tgz#aa3330a60d152d0868f13a56292af38a34ccac70"
|
||||
integrity sha512-e95NXcFzLArNPz3QYTzo2WjTyu27Gv7v2LJoiezZQknek7E+53kaJMKv3+0ceLV6C/aCcsUtMuRaKerOnNyMVw==
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
|
|
@ -51,7 +51,9 @@ type Entry {
|
|||
|
||||
"""A list of options for the sort order of the feed"""
|
||||
enum FeedType {
|
||||
"""Sort by a combination of freshness and score, using Reddit's algorithm"""
|
||||
"""
|
||||
Sort by a combination of freshness and score, using Reddit's algorithm
|
||||
"""
|
||||
HOT
|
||||
|
||||
"""Newest entries first"""
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"apollo-server": "2.2.0-alpha.2",
|
||||
"githunt-api": "apollographql/GitHunt-API.git",
|
||||
"githunt-api": "TimMikeladze/GitHunt-API",
|
||||
"graphql": "^14.0.2",
|
||||
"nexus": "0.12.0-beta.4"
|
||||
"nexus": "0.12.0-beta.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^1.18.6",
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
declare global {
|
||||
interface NexusGen extends NexusGenTypes {}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,7 @@
|
|||
"apollo-server": "^2.2.0",
|
||||
"graphql": "^14.0.2",
|
||||
"graphql-subscriptions": "^1.0.0",
|
||||
"nexus": "0.12.0-beta.1",
|
||||
"nexus": "0.12.0-beta.6",
|
||||
"subscriptions-transport-ws": "^0.9.15",
|
||||
"ts-node-dev": "^1.0.0-pre.30"
|
||||
},
|
||||
|
|
|
@ -3273,10 +3273,10 @@ negotiator@0.6.1:
|
|||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=
|
||||
|
||||
nexus@0.12.0-beta.1:
|
||||
version "0.12.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.1.tgz#d11cfb929def1d7ec03adbbbb616d377f63e9da0"
|
||||
integrity sha512-5gHmcZ2ksQbYV5O8Jj33FY0mXmIPurGo9CbzkSa9wUhtleMz2zygmgsvgt8oRB98rZkOPwwusZ5q9JX4sfdx5w==
|
||||
nexus@0.12.0-beta.6:
|
||||
version "0.12.0-beta.6"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.6.tgz#24829f4014365446972fdc066517893f36dd394e"
|
||||
integrity sha512-6eqZslOSZFSMQ3RJSk5EAAkB6uOlg7aYK5AyLMLMVTYX5iY9Tm8GWTHso5+lhmwIqPZHw+kDOYux6rRcYi9heA==
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
@ -4569,9 +4569,9 @@ tsconfig@^7.0.0:
|
|||
strip-json-comments "^2.0.0"
|
||||
|
||||
tslib@^1.9.3:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
||||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"graphql": "14.1.1",
|
||||
"graphql-yoga": "1.17.4",
|
||||
"nexus": "0.10.0",
|
||||
"nexus-prisma": "0.3.3",
|
||||
"nexus-prisma": "0.3.8",
|
||||
"prisma-client-lib": "1.27.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +1,8 @@
|
|||
/**
|
||||
* This file was automatically generated by nexus-prisma@0.3.7
|
||||
* Do not make changes to this file directly
|
||||
*/
|
||||
|
||||
export { default } from './datamodel-info'
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,162 +1,139 @@
|
|||
/**
|
||||
* This file was automatically generated by Nexus 0.9.11
|
||||
* This file was automatically generated by Nexus 0.11.7
|
||||
* Do not make changes to this file directly
|
||||
*/
|
||||
|
||||
import * as types from '../types'
|
||||
import * as types from "../types"
|
||||
|
||||
|
||||
declare global {
|
||||
interface NexusGen extends NexusGenTypes {}
|
||||
}
|
||||
|
||||
export interface NexusGenInputs {}
|
||||
|
||||
export interface NexusGenEnums {}
|
||||
|
||||
export interface NexusGenRootTypes {
|
||||
Mutation: {}
|
||||
Post: {
|
||||
// root type
|
||||
content?: string | null // String
|
||||
createdAt: any // DateTime!
|
||||
id: string // ID!
|
||||
published: boolean // Boolean!
|
||||
title: string // String!
|
||||
updatedAt: any // DateTime!
|
||||
}
|
||||
Query: {}
|
||||
User: {
|
||||
// root type
|
||||
email: string // String!
|
||||
id: string // ID!
|
||||
name?: string | null // String
|
||||
}
|
||||
String: string
|
||||
Int: number
|
||||
Float: number
|
||||
Boolean: boolean
|
||||
ID: string
|
||||
DateTime: any
|
||||
export interface NexusGenInputs {
|
||||
}
|
||||
|
||||
export interface NexusGenAllTypes extends NexusGenRootTypes {}
|
||||
export interface NexusGenEnums {
|
||||
}
|
||||
|
||||
export interface NexusGenRootTypes {
|
||||
Mutation: {};
|
||||
Post: { // root type
|
||||
content?: string | null; // String
|
||||
createdAt: any; // DateTime!
|
||||
id: string; // ID!
|
||||
published: boolean; // Boolean!
|
||||
title: string; // String!
|
||||
updatedAt: any; // DateTime!
|
||||
}
|
||||
Query: {};
|
||||
User: { // root type
|
||||
email: string; // String!
|
||||
id: string; // ID!
|
||||
name?: string | null; // String
|
||||
}
|
||||
String: string;
|
||||
Int: number;
|
||||
Float: number;
|
||||
Boolean: boolean;
|
||||
ID: string;
|
||||
DateTime: any;
|
||||
}
|
||||
|
||||
export interface NexusGenAllTypes extends NexusGenRootTypes {
|
||||
}
|
||||
|
||||
export interface NexusGenFieldTypes {
|
||||
Mutation: {
|
||||
// field return type
|
||||
createDraft: NexusGenRootTypes['Post'] | null // Post
|
||||
deletePost: NexusGenRootTypes['Post'] | null // Post
|
||||
publish: NexusGenRootTypes['Post'] | null // Post
|
||||
signupUser: NexusGenRootTypes['User'] | null // User
|
||||
Mutation: { // field return type
|
||||
createDraft: NexusGenRootTypes['Post'] | null; // Post
|
||||
deletePost: NexusGenRootTypes['Post'] | null; // Post
|
||||
publish: NexusGenRootTypes['Post'] | null; // Post
|
||||
signupUser: NexusGenRootTypes['User'] | null; // User
|
||||
}
|
||||
Post: {
|
||||
// field return type
|
||||
author: NexusGenRootTypes['User'] // User!
|
||||
content: string | null // String
|
||||
createdAt: any // DateTime!
|
||||
id: string // ID!
|
||||
published: boolean // Boolean!
|
||||
title: string // String!
|
||||
updatedAt: any // DateTime!
|
||||
Post: { // field return type
|
||||
author: NexusGenRootTypes['User']; // User!
|
||||
content: string | null; // String
|
||||
createdAt: any; // DateTime!
|
||||
id: string; // ID!
|
||||
published: boolean; // Boolean!
|
||||
title: string; // String!
|
||||
updatedAt: any; // DateTime!
|
||||
}
|
||||
Query: {
|
||||
// field return type
|
||||
feed: NexusGenRootTypes['Post'][] | null // [Post!]
|
||||
filterPosts: NexusGenRootTypes['Post'][] | null // [Post!]
|
||||
post: NexusGenRootTypes['Post'] | null // Post
|
||||
Query: { // field return type
|
||||
feed: NexusGenRootTypes['Post'][] | null; // [Post!]
|
||||
filterPosts: NexusGenRootTypes['Post'][] | null; // [Post!]
|
||||
post: NexusGenRootTypes['Post'] | null; // Post
|
||||
}
|
||||
User: {
|
||||
// field return type
|
||||
email: string // String!
|
||||
id: string // ID!
|
||||
name: string | null // String
|
||||
posts: NexusGenRootTypes['Post'][] | null // [Post!]
|
||||
User: { // field return type
|
||||
email: string; // String!
|
||||
id: string; // ID!
|
||||
name: string | null; // String
|
||||
posts: NexusGenRootTypes['Post'][] | null; // [Post!]
|
||||
}
|
||||
}
|
||||
|
||||
export interface NexusGenArgTypes {
|
||||
Mutation: {
|
||||
createDraft: {
|
||||
// args
|
||||
authorEmail?: string | null // String
|
||||
content?: string | null // String
|
||||
title?: string | null // String
|
||||
createDraft: { // args
|
||||
authorEmail?: string | null; // String
|
||||
content?: string | null; // String
|
||||
title?: string | null; // String
|
||||
}
|
||||
deletePost: {
|
||||
// args
|
||||
id?: string | null // ID
|
||||
deletePost: { // args
|
||||
id?: string | null; // ID
|
||||
}
|
||||
publish: {
|
||||
// args
|
||||
id?: string | null // ID
|
||||
publish: { // args
|
||||
id?: string | null; // ID
|
||||
}
|
||||
signupUser: {
|
||||
// args
|
||||
email?: string | null // String
|
||||
name?: string | null // String
|
||||
signupUser: { // args
|
||||
email?: string | null; // String
|
||||
name?: string | null; // String
|
||||
}
|
||||
}
|
||||
Query: {
|
||||
filterPosts: {
|
||||
// args
|
||||
searchString?: string | null // String
|
||||
filterPosts: { // args
|
||||
searchString?: string | null; // String
|
||||
}
|
||||
post: {
|
||||
// args
|
||||
id?: string | null // ID
|
||||
post: { // args
|
||||
id?: string | null; // ID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface NexusGenAbstractResolveReturnTypes {}
|
||||
export interface NexusGenAbstractResolveReturnTypes {
|
||||
}
|
||||
|
||||
export interface NexusGenInheritedFields {}
|
||||
|
||||
export type NexusGenObjectNames = 'Mutation' | 'Post' | 'Query' | 'User'
|
||||
export type NexusGenObjectNames = "Mutation" | "Post" | "Query" | "User";
|
||||
|
||||
export type NexusGenInputNames = never
|
||||
export type NexusGenInputNames = never;
|
||||
|
||||
export type NexusGenEnumNames = never
|
||||
export type NexusGenEnumNames = never;
|
||||
|
||||
export type NexusGenInterfaceNames = never
|
||||
export type NexusGenInterfaceNames = never;
|
||||
|
||||
export type NexusGenScalarNames =
|
||||
| 'Boolean'
|
||||
| 'DateTime'
|
||||
| 'Float'
|
||||
| 'ID'
|
||||
| 'Int'
|
||||
| 'String'
|
||||
export type NexusGenScalarNames = "Boolean" | "DateTime" | "Float" | "ID" | "Int" | "String";
|
||||
|
||||
export type NexusGenUnionNames = never
|
||||
export type NexusGenUnionNames = never;
|
||||
|
||||
export interface NexusGenTypes {
|
||||
context: types.Context
|
||||
inputTypes: NexusGenInputs
|
||||
rootTypes: NexusGenRootTypes
|
||||
argTypes: NexusGenArgTypes
|
||||
fieldTypes: NexusGenFieldTypes
|
||||
allTypes: NexusGenAllTypes
|
||||
inheritedFields: NexusGenInheritedFields
|
||||
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']
|
||||
abstractResolveReturn: NexusGenAbstractResolveReturnTypes
|
||||
}
|
||||
context: types.Context;
|
||||
inputTypes: NexusGenInputs;
|
||||
rootTypes: NexusGenRootTypes;
|
||||
argTypes: NexusGenArgTypes;
|
||||
fieldTypes: NexusGenFieldTypes;
|
||||
allTypes: NexusGenAllTypes;
|
||||
inheritedFields: NexusGenInheritedFields;
|
||||
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'];
|
||||
abstractResolveReturn: NexusGenAbstractResolveReturnTypes;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
### This file was autogenerated by Nexus 0.9.11
|
||||
### This file was autogenerated by Nexus 0.11.7
|
||||
### Do not make changes to this file directly
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import * as path from 'path'
|
|||
import datamodelInfo from './generated/nexus-prisma'
|
||||
import { prisma } from './generated/prisma-client'
|
||||
|
||||
// @ts-ignore "Expression produces a union type that is too complex to represent."
|
||||
const User = prismaObjectType({
|
||||
name: 'User',
|
||||
definition(t) {
|
||||
|
|
|
@ -90,7 +90,12 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.4.tgz#ceb0048a546db453f6248f2d1d95e937a6f00a14"
|
||||
integrity sha512-Zl8dGvAcEmadgs1tmSPcvwzO1YRsz38bVJQvH1RvRqSR9/5n61Q1ktcDL0ht3FXWR+ZpVmXVwN1LuH4Ax23NsA==
|
||||
|
||||
"@types/node@10.12.26", "@types/node@^10.12.0":
|
||||
"@types/node@10.12.27":
|
||||
version "10.12.27"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.27.tgz#eb3843f15d0ba0986cc7e4d734d2ee8b50709ef8"
|
||||
integrity sha512-e9wgeY6gaY21on3ve0xAjgBVjGDWq/xUteK0ujsE53bUoxycMkqfnkUgMt6ffZtykZ5X12Mg3T7Pw4TRCObDKg==
|
||||
|
||||
"@types/node@^10.12.0":
|
||||
version "10.12.26"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.26.tgz#2dec19f1f7981c95cb54bab8f618ecb5dc983d0e"
|
||||
integrity sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg==
|
||||
|
@ -1308,15 +1313,15 @@ negotiator@0.6.1:
|
|||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=
|
||||
|
||||
nexus-prisma@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/nexus-prisma/-/nexus-prisma-0.3.1.tgz#26eb370a1c082d28ec50f1171ca7a6f0ce864c96"
|
||||
integrity sha512-ixA49PsqXsigBI4VHuTnYpeVXBAaTYOV54dCXGwdtnI9B3vdb7nwpcBn9mJ6m1PsqItMgDN/0e9F4G2OTbM/rQ==
|
||||
nexus-prisma@0.3.8:
|
||||
version "0.3.8"
|
||||
resolved "https://registry.yarnpkg.com/nexus-prisma/-/nexus-prisma-0.3.8.tgz#19a94663903c7af17d63873476baeff845689d3c"
|
||||
integrity sha512-F+i6nKnT+a7RzvnYTwBTV5V6mW+euYm7nUbQUKw1DRJSWQfWbrHG/Jh3y0fx6iz6nIb8bDY9AozqILwNlhxFXA==
|
||||
|
||||
nexus@0.9.14:
|
||||
version "0.9.14"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.9.14.tgz#95b8360ced652070c464146e45803e2a4aaa66b4"
|
||||
integrity sha512-fJp6fZF7C55NFX433/ndcLrtjABbQ14krKcaR2fWoQVHrgsSRJ4VKFPDYoO5yIwSppdvptlC6oHT3Zl6oq3XUw==
|
||||
nexus@0.10.0:
|
||||
version "0.10.0"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.10.0.tgz#551e36852c3761d0e449fb845cd618a74bdb6dc2"
|
||||
integrity sha512-dbd9JPOtVsOWy7I4Q2IiXC2WLPGUwc1dwqaCI7s5NMZm55wkTwCqFGz5yH9gpYHNfGvyQmQvhPx5hRvgpQU/uw==
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
@ -1468,10 +1473,10 @@ prettier@1.14.3:
|
|||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895"
|
||||
integrity sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==
|
||||
|
||||
prisma-client-lib@1.27.0:
|
||||
version "1.27.0"
|
||||
resolved "https://registry.yarnpkg.com/prisma-client-lib/-/prisma-client-lib-1.27.0.tgz#a574f4fb521a1e08d4494d312d75c9cc53be3612"
|
||||
integrity sha512-9d65h1GtwJo9yvsjJegSL6gcdQbSujlAFHcmJGoqCmQ4Ion9DPFkflc3540pNtXUKoa7V8SqGXd5uqWxJEP4YQ==
|
||||
prisma-client-lib@1.27.1:
|
||||
version "1.27.1"
|
||||
resolved "https://registry.yarnpkg.com/prisma-client-lib/-/prisma-client-lib-1.27.1.tgz#442429b4f54fbbd752a20f149214f3eb72bc1df3"
|
||||
integrity sha512-+YSDyjsvUQ+Gnr4Hco59QOLMJqMgavubFUzAH27VHQHkzEKh4EVpfRhELqYK4CSTOWCCb6p7Vs9Rk7LhmGod4Q==
|
||||
dependencies:
|
||||
"@types/node" "^10.12.0"
|
||||
"@types/prettier" "^1.13.2"
|
||||
|
@ -1482,31 +1487,31 @@ prisma-client-lib@1.27.0:
|
|||
jsonwebtoken "^8.3.0"
|
||||
lodash.flatten "^4.4.0"
|
||||
prettier "1.14.3"
|
||||
prisma-datamodel "1.27.0"
|
||||
prisma-generate-schema "1.27.0"
|
||||
prisma-datamodel "1.27.1"
|
||||
prisma-generate-schema "1.27.1"
|
||||
subscriptions-transport-ws "^0.9.15"
|
||||
uppercamelcase "^3.0.0"
|
||||
ws "^6.1.0"
|
||||
zen-observable "^0.8.10"
|
||||
|
||||
prisma-datamodel@1.27.0:
|
||||
version "1.27.0"
|
||||
resolved "https://registry.yarnpkg.com/prisma-datamodel/-/prisma-datamodel-1.27.0.tgz#5ab17c1104db8f8c06791cf8fa06909c4a4bd5dc"
|
||||
integrity sha512-M8FL8agbymCMpjza7c1dxgpWkyjhB+w0OeDTwBdA7OTUx62Jn02ySdJ5wNac0E6qpDMDphgAGovoD8+cYJVZIg==
|
||||
prisma-datamodel@1.27.1:
|
||||
version "1.27.1"
|
||||
resolved "https://registry.yarnpkg.com/prisma-datamodel/-/prisma-datamodel-1.27.1.tgz#e95482d9c309bf751e4bf0f41f1c07f1458d0ae9"
|
||||
integrity sha512-OQKwYc/s4nNZ3VXZXSyQBEKGVQnKCcjIySjfyaQ1d0z9vwHqR1e2BhdfnK65b0PbndK2IQIAuiSF/gj+waYgbw==
|
||||
dependencies:
|
||||
graphql "^14.0.2"
|
||||
pluralize "^7.0.0"
|
||||
popsicle "10"
|
||||
|
||||
prisma-generate-schema@1.27.0:
|
||||
version "1.27.0"
|
||||
resolved "https://registry.yarnpkg.com/prisma-generate-schema/-/prisma-generate-schema-1.27.0.tgz#d938438d04dfc586abc59993ccba9035f2e81897"
|
||||
integrity sha512-xeQ1YI/2oq4/iRaaxyE6tBVZv65FnL/AjVJCjA0ysXD38MGyIVoIVKahuvVdPqwHL84YipxygfJK8sQbK1lwCQ==
|
||||
prisma-generate-schema@1.27.1:
|
||||
version "1.27.1"
|
||||
resolved "https://registry.yarnpkg.com/prisma-generate-schema/-/prisma-generate-schema-1.27.1.tgz#d8af8e907c84806290793a819bf2901e3c3da3d0"
|
||||
integrity sha512-/HescvrD+KoBURvDWo3RQSpT1ocEZV4uJxCGdXwsmYmdxu8U9yyAQsvmBwUvN6/HnbSkqjFa8ZGoXjEZ5TpgIg==
|
||||
dependencies:
|
||||
graphql "^14.0.2"
|
||||
pluralize "^7.0.0"
|
||||
popsicle "10"
|
||||
prisma-datamodel "1.27.0"
|
||||
prisma-datamodel "1.27.1"
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.0"
|
||||
|
@ -1910,10 +1915,10 @@ typedarray@^0.0.6:
|
|||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@3.3.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221"
|
||||
integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==
|
||||
typescript@^3.4.5:
|
||||
version "3.6.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da"
|
||||
integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==
|
||||
|
||||
unpipe@1.0.0, unpipe@~1.0.0:
|
||||
version "1.0.0"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"dependencies": {
|
||||
"apollo-server": "^2.2.0",
|
||||
"graphql": "^14.0.2",
|
||||
"nexus": "0.12.0-beta.4",
|
||||
"nexus": "0.12.0-beta.9",
|
||||
"ts-node-dev": "^1.0.0-pre.30"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -102,9 +102,7 @@ function getCharacter(id: string) {
|
|||
/**
|
||||
* Allows us to query for a character's friends.
|
||||
*/
|
||||
export function getFriends(
|
||||
character: Character
|
||||
): Array<Promise<Human | Droid>> {
|
||||
export function getFriends(character: Character) {
|
||||
// Notice that GraphQL accepts Arrays of Promises.
|
||||
return character.friends.map((id) => getCharacter(id));
|
||||
}
|
||||
|
|
|
@ -10,12 +10,18 @@ export const schema = makeSchema({
|
|||
types: allTypes,
|
||||
outputs: {
|
||||
schema: path.join(__dirname, "../star-wars-schema.graphql"),
|
||||
typegen: path.join(__dirname, "./star-wars-typegen.ts"),
|
||||
typegen: path.join(
|
||||
__dirname.replace(/\/dist$/, "/src"),
|
||||
"./star-wars-typegen.ts"
|
||||
),
|
||||
},
|
||||
typegenAutoConfig: {
|
||||
sources: [
|
||||
{
|
||||
source: path.join(__dirname, "./types/backingTypes.ts"),
|
||||
source: path.join(
|
||||
__dirname.replace(/\/dist$/, "/src"),
|
||||
"./types/backingTypes.ts"
|
||||
),
|
||||
alias: "swapi",
|
||||
},
|
||||
],
|
||||
|
|
|
@ -8,6 +8,7 @@ import * as swapi from "./types/backingTypes"
|
|||
|
||||
|
||||
|
||||
|
||||
declare global {
|
||||
interface NexusGen extends NexusGenTypes {}
|
||||
}
|
||||
|
|
|
@ -3273,10 +3273,10 @@ negotiator@0.6.1:
|
|||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=
|
||||
|
||||
nexus@0.12.0-beta.4:
|
||||
version "0.12.0-beta.4"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.4.tgz#bd561527e48c09012318814add492e9b5df65061"
|
||||
integrity sha512-6wJvqyEVUY3Psc7Ywv8ngVi0BWQyFQBKe3L/E4A1OdkNgutzjCAMxwSr9PFY3tFTc6eeSMlXNsaunGkRwgJlDg==
|
||||
nexus@0.12.0-beta.9:
|
||||
version "0.12.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.9.tgz#aa3330a60d152d0868f13a56292af38a34ccac70"
|
||||
integrity sha512-e95NXcFzLArNPz3QYTzo2WjTyu27Gv7v2LJoiezZQknek7E+53kaJMKv3+0ceLV6C/aCcsUtMuRaKerOnNyMVw==
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"apollo-server": "^2.2.5",
|
||||
"fs-extra": "^7.0.1",
|
||||
"graphql": "^14.0.2",
|
||||
"nexus": "0.12.0-beta.1",
|
||||
"nexus": "0.12.0-beta.9",
|
||||
"ts-node-dev": "1.0.0-pre.31",
|
||||
"typescript": "^3.4.5"
|
||||
},
|
||||
|
|
|
@ -9,6 +9,7 @@ import ts from "typescript"
|
|||
|
||||
|
||||
|
||||
|
||||
declare global {
|
||||
interface NexusGen extends NexusGenTypes {}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { interfaceType, objectType, core, Types } from "nexus";
|
||||
import { interfaceType, objectType, blocks } from "nexus";
|
||||
import ts from "typescript";
|
||||
|
||||
export const JSDoc = objectType({
|
||||
|
@ -26,7 +26,7 @@ export const JSDocTag = interfaceType({
|
|||
},
|
||||
});
|
||||
|
||||
const jsDocTag = (t: Types.ObjectDefinitionBlock<any>) =>
|
||||
const jsDocTag = (t: blocks.ObjectDefinitionBlock<any>) =>
|
||||
t.implements("JSDocTag");
|
||||
|
||||
export const JSDocUnknownTag = objectType({
|
||||
|
|
|
@ -67,13 +67,13 @@ export const TypeReference = objectType({
|
|||
t.string("text", {
|
||||
nullable: true,
|
||||
resolve: (root) => {
|
||||
return root.typeName && root.typeName.text;
|
||||
return root.typeName && (root.typeName as any).text;
|
||||
},
|
||||
});
|
||||
t.string("nameText", {
|
||||
nullable: true,
|
||||
resolve: (root) => {
|
||||
return root.typeName && root.typeName.escapedText;
|
||||
return root.typeName && (root.typeName as any).escapedText;
|
||||
},
|
||||
});
|
||||
t.list.field("typeArguments", { type: "Node", nullable: true });
|
||||
|
|
|
@ -17,7 +17,7 @@ export const DeclarationName = unionType({
|
|||
);
|
||||
t.resolveType((obj) => {
|
||||
if ("kind" in obj) {
|
||||
if (obj.kind === ts.SyntaxKind.FirstNode) {
|
||||
if ((obj.kind as unknown) === ts.SyntaxKind.FirstNode) {
|
||||
return "QualifiedName";
|
||||
}
|
||||
return ts.SyntaxKind[
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { GraphQLSchema, isObjectType, GraphQLResolveInfo } from "graphql";
|
||||
import ts from "typescript";
|
||||
import {
|
||||
SourceFileStatementsArgs,
|
||||
NodeModifiersArgs,
|
||||
} from "../ts-ast-reader-typegen";
|
||||
import { ContextType } from ".";
|
||||
import { NexusGenArgTypes } from "../ts-ast-reader-typegen";
|
||||
|
||||
export function convertTsEnum(toConvert: any) {
|
||||
const converted: { [key: string]: number } = {};
|
||||
|
@ -38,7 +34,7 @@ export function allKnownNodes(schema: GraphQLSchema) {
|
|||
}
|
||||
|
||||
export const filteredNodesList = <T extends ts.Node>(
|
||||
args: SourceFileStatementsArgs,
|
||||
args: NexusGenArgTypes["SourceFile"]["statements"],
|
||||
nodes: T[]
|
||||
) => {
|
||||
const { skip, only } = args;
|
||||
|
@ -57,7 +53,7 @@ export const filteredNodesList = <T extends ts.Node>(
|
|||
};
|
||||
|
||||
export const syntaxKindFilter = <T extends { kind: ts.SyntaxKind }>(
|
||||
args: NodeModifiersArgs,
|
||||
args: NexusGenArgTypes["Node"]["modifiers"],
|
||||
items: T[]
|
||||
) => {
|
||||
const { skip, only } = args;
|
||||
|
|
|
@ -1251,10 +1251,10 @@ negotiator@0.6.1:
|
|||
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
|
||||
integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=
|
||||
|
||||
nexus@0.12.0-beta.1:
|
||||
version "0.12.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.1.tgz#d11cfb929def1d7ec03adbbbb616d377f63e9da0"
|
||||
integrity sha512-5gHmcZ2ksQbYV5O8Jj33FY0mXmIPurGo9CbzkSa9wUhtleMz2zygmgsvgt8oRB98rZkOPwwusZ5q9JX4sfdx5w==
|
||||
nexus@0.12.0-beta.9:
|
||||
version "0.12.0-beta.9"
|
||||
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.12.0-beta.9.tgz#aa3330a60d152d0868f13a56292af38a34ccac70"
|
||||
integrity sha512-e95NXcFzLArNPz3QYTzo2WjTyu27Gv7v2LJoiezZQknek7E+53kaJMKv3+0ceLV6C/aCcsUtMuRaKerOnNyMVw==
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
@ -1735,9 +1735,9 @@ tsconfig@^7.0.0:
|
|||
strip-json-comments "^2.0.0"
|
||||
|
||||
tslib@^1.9.3:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
||||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
||||
|
||||
type-is@^1.6.16, type-is@~1.6.16:
|
||||
version "1.6.16"
|
||||
|
|
|
@ -2772,13 +2772,8 @@ neo-async@^2.6.0:
|
|||
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
|
||||
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
|
||||
|
||||
"nexus@file:.":
|
||||
version "0.12.0-beta.7"
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
"nexus@file:./.":
|
||||
version "0.12.0-beta.7"
|
||||
version "0.12.0-beta.9"
|
||||
dependencies:
|
||||
tslib "^1.9.3"
|
||||
|
||||
|
|
Loading…
Reference in New Issue