diff --git a/packages/apollo/tests/code-first/cats/cats.resolver.ts b/packages/apollo/tests/code-first/cats/cats.resolver.ts index 907d4ac52..95cf34c83 100644 --- a/packages/apollo/tests/code-first/cats/cats.resolver.ts +++ b/packages/apollo/tests/code-first/cats/cats.resolver.ts @@ -1,8 +1,4 @@ -<<<<<<< HEAD -import { Query, Resolver, Args } from '@nestjs/graphql'; -======= import { Args, Query, Resolver } from '@nestjs/graphql'; ->>>>>>> 7624329 (chore(code-first): update imports to workspace paths) import { CatType } from '../enums/cat-type.enum'; @Resolver() @@ -12,7 +8,6 @@ export class CatsResolver { return 'cat'; } - @Resolver() @Query((returns) => CatType) catType( @Args({ name: 'catType', type: () => CatType }) diff --git a/packages/apollo/tests/code-first/enums/cat-type.enum.ts b/packages/apollo/tests/code-first/enums/cat-type.enum.ts index f51d741c4..60e2ee75f 100644 --- a/packages/apollo/tests/code-first/enums/cat-type.enum.ts +++ b/packages/apollo/tests/code-first/enums/cat-type.enum.ts @@ -1,12 +1,11 @@ import { registerEnumType } from '@nestjs/graphql'; -<<<<<<< HEAD -======= ->>>>>>> 7624329 (chore(code-first): update imports to workspace paths) export enum CatType { PersianCat = 'persian-cat', MaineCoon = 'maine-coon', Ragdoll = 'ragdoll', + SomeNewAwesomeCat = 'some-new-awesome-cat', + SomeWEIRDCat = 'some-weird-cat', } registerEnumType(CatType, { diff --git a/packages/apollo/tests/e2e/code-first-schema.spec.ts b/packages/apollo/tests/e2e/code-first-schema.spec.ts index 26ac6d6c5..ffb9e02b6 100644 --- a/packages/apollo/tests/e2e/code-first-schema.spec.ts +++ b/packages/apollo/tests/e2e/code-first-schema.spec.ts @@ -70,10 +70,10 @@ describe('Code-first - schema factory', () => { printedSchemaSnapshot, ); }); - it('should define 6 queries', async () => { + it('should define 7 queries', async () => { const type = getQuery(introspectionSchema); - expect(type.fields.length).toEqual(6); + expect(type.fields.length).toEqual(7); expect(type.fields.map((item) => item.name)).toEqual( expect.arrayContaining([ 'recipes', @@ -186,6 +186,18 @@ describe('Code-first - schema factory', () => { isDeprecated: false, name: 'RAGDOLL', }, + { + deprecationReason: null, + description: null, + isDeprecated: false, + name: 'SOME_NEW_AWESOME_CAT', + }, + { + deprecationReason: null, + description: null, + isDeprecated: false, + name: 'SOME_WEIRD_CAT', + }, ], }), ); diff --git a/packages/apollo/tests/graphql/sort-auto-schema.module.ts b/packages/apollo/tests/graphql/sort-auto-schema.module.ts index d7c0e330c..ff0ff0b7a 100644 --- a/packages/apollo/tests/graphql/sort-auto-schema.module.ts +++ b/packages/apollo/tests/graphql/sort-auto-schema.module.ts @@ -9,7 +9,7 @@ import { CatsModule } from '../code-first/cats/cats.module'; imports: [ RecipesModule, DirectionsModule, - CatsModule, + CatsModule.register('useClass'), GraphQLModule.forRoot({ driver: ApolloDriver, autoSchemaFile: 'schema.graphql', diff --git a/packages/apollo/tests/graphql/transform-auto-schema-file.module.ts b/packages/apollo/tests/graphql/transform-auto-schema-file.module.ts index e663a6060..923de0cce 100644 --- a/packages/apollo/tests/graphql/transform-auto-schema-file.module.ts +++ b/packages/apollo/tests/graphql/transform-auto-schema-file.module.ts @@ -10,7 +10,7 @@ import { CatsModule } from '../code-first/cats/cats.module'; imports: [ RecipesModule, DirectionsModule, - CatsModule, + CatsModule.register('useClass'), GraphQLModule.forRoot({ driver: ApolloDriver, autoSchemaFile: 'schema.graphql', diff --git a/packages/apollo/tests/utils/printed-schema.snapshot.ts b/packages/apollo/tests/utils/printed-schema.snapshot.ts index 7865f39e2..811d65085 100644 --- a/packages/apollo/tests/utils/printed-schema.snapshot.ts +++ b/packages/apollo/tests/utils/printed-schema.snapshot.ts @@ -75,6 +75,7 @@ type Query { take: Int = 25 ): [Recipe!]! move(direction: Direction!): Direction! + getAnimalName: String! catType(catType: CatType!): CatType! } @@ -96,6 +97,8 @@ enum CatType { PERSIAN_CAT MAINE_COON RAGDOLL + SOME_NEW_AWESOME_CAT + SOME_WEIRD_CAT } type Mutation { @@ -126,6 +129,8 @@ enum CatType { MAINE_COON PERSIAN_CAT RAGDOLL + SOME_NEW_AWESOME_CAT + SOME_WEIRD_CAT } type Category { @@ -179,6 +184,7 @@ input NewRecipeInput { type Query { catType(catType: CatType!): CatType! categories: [Category!]! + getAnimalName: String! move(direction: Direction!): Direction! """get recipe by id"""