Skip to content
Permalink
Browse files

feat(examples): add generated files to examples (#231)

  • Loading branch information...
goldcaddy77 committed Oct 31, 2019
1 parent 8f68e42 commit 52420feb31504652ef1d4f5dc26759cf6bdc46af
Showing with 9,112 additions and 3,182 deletions.
  1. +1 −1 .gitignore
  2. +249 −0 examples/01-simple-model/generated/binding.ts
  3. +215 −0 examples/01-simple-model/generated/classes.ts
  4. +1 −0 examples/01-simple-model/generated/index.ts
  5. +3 −0 examples/01-simple-model/generated/ormconfig.ts
  6. +194 −0 examples/01-simple-model/generated/schema.graphql
  7. +12 −397 examples/01-simple-model/yarn.lock
  8. +264 −0 examples/02-complex-example/generated/binding.ts
  9. +248 −0 examples/02-complex-example/generated/classes.ts
  10. +1 −0 examples/02-complex-example/generated/index.ts
  11. +3 −0 examples/02-complex-example/generated/ormconfig.ts
  12. +214 −0 examples/02-complex-example/generated/schema.graphql
  13. +1 −1 examples/02-complex-example/package.json
  14. +5 −4 examples/02-complex-example/src/modules/user/user.model.ts
  15. +12 −397 examples/02-complex-example/yarn.lock
  16. +270 −0 examples/03-one-to-many-relationship/generated/binding.ts
  17. +187 −0 examples/03-one-to-many-relationship/generated/classes.ts
  18. +1 −0 examples/03-one-to-many-relationship/generated/index.ts
  19. +3 −0 examples/03-one-to-many-relationship/generated/ormconfig.ts
  20. +222 −0 examples/03-one-to-many-relationship/generated/schema.graphql
  21. +12 −397 examples/03-one-to-many-relationship/yarn.lock
  22. +459 −0 examples/04-many-to-many-relationship/generated/binding.ts
  23. +433 −0 examples/04-many-to-many-relationship/generated/classes.ts
  24. +1 −0 examples/04-many-to-many-relationship/generated/index.ts
  25. +3 −0 examples/04-many-to-many-relationship/generated/ormconfig.ts
  26. +415 −0 examples/04-many-to-many-relationship/generated/schema.graphql
  27. +12 −397 examples/04-many-to-many-relationship/yarn.lock
  28. +210 −0 examples/05-migrations/generated/binding.ts
  29. +146 −0 examples/05-migrations/generated/classes.ts
  30. +1 −0 examples/05-migrations/generated/index.ts
  31. +3 −0 examples/05-migrations/generated/ormconfig.ts
  32. +158 −0 examples/05-migrations/generated/schema.graphql
  33. +12 −397 examples/05-migrations/yarn.lock
  34. +204 −0 examples/06-base-service/generated/binding.ts
  35. +119 −0 examples/06-base-service/generated/classes.ts
  36. +1 −0 examples/06-base-service/generated/index.ts
  37. +3 −0 examples/06-base-service/generated/ormconfig.ts
  38. +154 −0 examples/06-base-service/generated/schema.graphql
  39. +12 −397 examples/06-base-service/yarn.lock
  40. +983 −0 examples/07-feature-flags/generated/binding.ts
  41. +1,312 −0 examples/07-feature-flags/generated/classes.ts
  42. +1 −0 examples/07-feature-flags/generated/index.ts
  43. +3 −0 examples/07-feature-flags/generated/ormconfig.ts
  44. +945 −0 examples/07-feature-flags/generated/schema.graphql
  45. +273 −0 examples/08-performance/generated/binding.ts
  46. +193 −0 examples/08-performance/generated/classes.ts
  47. +1 −0 examples/08-performance/generated/index.ts
  48. +3 −0 examples/08-performance/generated/ormconfig.ts
  49. +225 −0 examples/08-performance/generated/schema.graphql
  50. +12 −397 examples/08-performance/yarn.lock
  51. +271 −0 examples/09-production/generated/binding.ts
  52. +187 −0 examples/09-production/generated/classes.ts
  53. +1 −0 examples/09-production/generated/index.ts
  54. +3 −0 examples/09-production/generated/ormconfig.ts
  55. +223 −0 examples/09-production/generated/schema.graphql
  56. +12 −397 examples/09-production/yarn.lock
@@ -23,4 +23,4 @@ tmp

warthog.sqlite.tmp

examples/**/generated/*
# examples/**/generated/*
@@ -0,0 +1,249 @@
import { makeBindingClass, Options } from 'graphql-binding'
import { GraphQLResolveInfo, GraphQLSchema } from 'graphql'
import { IResolvers } from 'graphql-tools/dist/Interfaces'
import * as schema from './schema.graphql'

export interface Query {
users: <T = Array<User>>(args: { offset?: Int | null, limit?: Int | null, where?: UserWhereInput | null, orderBy?: UserOrderByInput | null }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
user: <T = User>(args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T>
}

export interface Mutation {
createUser: <T = User>(args: { data: UserCreateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
updateUser: <T = User>(args: { data: UserUpdateInput, where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T> ,
deleteUser: <T = StandardDeleteResponse>(args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise<T>
}

export interface Subscription {}

export interface Binding {
query: Query
mutation: Mutation
subscription: Subscription
request: <T = any>(query: string, variables?: {[key: string]: any}) => Promise<T>
delegate(operation: 'query' | 'mutation', fieldName: string, args: {
[key: string]: any;
}, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise<any>;
delegateSubscription(fieldName: string, args?: {
[key: string]: any;
}, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise<AsyncIterator<any>>;
getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers;
}

export interface BindingConstructor<T> {
new(...args: any[]): T
}

export const Binding = makeBindingClass<BindingConstructor<Binding>>({ schema })

/**
* Types
*/

export type UserOrderByInput = 'createdAt_ASC' |
'createdAt_DESC' |
'updatedAt_ASC' |
'updatedAt_DESC' |
'deletedAt_ASC' |
'deletedAt_DESC' |
'firstName_ASC' |
'firstName_DESC' |
'lastName_ASC' |
'lastName_DESC' |
'email_ASC' |
'email_DESC' |
'age_ASC' |
'age_DESC' |
'isRequired_ASC' |
'isRequired_DESC' |
'rating_ASC' |
'rating_DESC'

export interface BaseWhereInput {
id_eq?: String | null
id_in?: String[] | String | null
createdAt_eq?: String | null
createdAt_lt?: String | null
createdAt_lte?: String | null
createdAt_gt?: String | null
createdAt_gte?: String | null
createdById_eq?: String | null
updatedAt_eq?: String | null
updatedAt_lt?: String | null
updatedAt_lte?: String | null
updatedAt_gt?: String | null
updatedAt_gte?: String | null
updatedById_eq?: String | null
deletedAt_all?: Boolean | null
deletedAt_eq?: String | null
deletedAt_lt?: String | null
deletedAt_lte?: String | null
deletedAt_gt?: String | null
deletedAt_gte?: String | null
deletedById_eq?: String | null
}

export interface UserCreateInput {
firstName: String
lastName?: String | null
email: String
age: Float
isRequired: Boolean
rating: Float
}

export interface UserUpdateInput {
firstName?: String | null
lastName?: String | null
email?: String | null
age?: Float | null
isRequired?: Boolean | null
rating?: Float | null
}

export interface UserWhereInput {
id_eq?: String | null
id_in?: String[] | String | null
createdAt_eq?: String | null
createdAt_lt?: String | null
createdAt_lte?: String | null
createdAt_gt?: String | null
createdAt_gte?: String | null
createdById_eq?: String | null
updatedAt_eq?: String | null
updatedAt_lt?: String | null
updatedAt_lte?: String | null
updatedAt_gt?: String | null
updatedAt_gte?: String | null
updatedById_eq?: String | null
deletedAt_all?: Boolean | null
deletedAt_eq?: String | null
deletedAt_lt?: String | null
deletedAt_lte?: String | null
deletedAt_gt?: String | null
deletedAt_gte?: String | null
deletedById_eq?: String | null
firstName_eq?: String | null
firstName_contains?: String | null
firstName_startsWith?: String | null
firstName_endsWith?: String | null
firstName_in?: String[] | String | null
lastName_eq?: String | null
lastName_contains?: String | null
lastName_startsWith?: String | null
lastName_endsWith?: String | null
lastName_in?: String[] | String | null
email_eq?: String | null
email_contains?: String | null
email_startsWith?: String | null
email_endsWith?: String | null
email_in?: String[] | String | null
age_eq?: Float | null
age_gt?: Float | null
age_gte?: Float | null
age_lt?: Float | null
age_lte?: Float | null
age_in?: Int[] | Int | null
isRequired_eq?: Boolean | null
isRequired_in?: Boolean[] | Boolean | null
rating_eq?: Float | null
rating_gt?: Float | null
rating_gte?: Float | null
rating_lt?: Float | null
rating_lte?: Float | null
rating_in?: Float[] | Float | null
}

export interface UserWhereUniqueInput {
id?: String | null
email?: String | null
}

export interface BaseGraphQLObject {
id: ID_Output
createdAt: DateTime
createdById: String
updatedAt?: DateTime | null
updatedById?: String | null
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
}

export interface DeleteResponse {
id: ID_Output
}

export interface BaseModel extends BaseGraphQLObject {
id: ID_Output
createdAt: DateTime
createdById: String
updatedAt?: DateTime | null
updatedById?: String | null
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
}

export interface BaseModelUUID extends BaseGraphQLObject {
id: ID_Output
createdAt: DateTime
createdById: String
updatedAt?: DateTime | null
updatedById?: String | null
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
}

export interface StandardDeleteResponse {
id: ID_Output
}

export interface User extends BaseGraphQLObject {
id: ID_Output
createdAt: DateTime
createdById: String
updatedAt?: DateTime | null
updatedById?: String | null
deletedAt?: DateTime | null
deletedById?: String | null
version: Int
firstName: String
lastName?: String | null
email: String
age: Int
isRequired: Boolean
rating: Float
}

/*
The `Boolean` scalar type represents `true` or `false`.
*/
export type Boolean = boolean

/*
The javascript `Date` as string. Type represents date and time as the ISO Date string.
*/
export type DateTime = Date | string

/*
The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
*/
export type Float = number

/*
The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
*/
export type ID_Input = string | number
export type ID_Output = string

/*
The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
*/
export type Int = number

/*
The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
*/
export type String = string

0 comments on commit 52420fe

Please sign in to comment.
You can’t perform that action at this time.