Skip to content

Commit

Permalink
test(examples): Update federation and federation v2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Oct 6, 2023
1 parent 0cf1021 commit d96f9a3
Show file tree
Hide file tree
Showing 62 changed files with 2,707 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AppModule } from '../src/app.module'
import { SubTaskDTO } from '../src/sub-task/dto/sub-task.dto'
import { edgeNodes, pageInfoField, refresh, subTaskFields, todoItemFields } from './__fixtures__'

describe('Federated - SubTaskResolver (e2e)', () => {
describe('Federated v2 - SubTaskResolver (e2e)', () => {
let app: INestApplication

beforeAll(async () => {
Expand Down
327 changes: 327 additions & 0 deletions examples/federation-v2/sub-task-graphql/schema.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------

type TodoItem {
id: ID!
subTasks(
"""Limit or page results."""
paging: CursorPaging! = {first: 10}

"""Specify to filter the records returned."""
filter: SubTaskFilter! = {}

"""Specify to sort results."""
sorting: [SubTaskSort!]! = []
): TodoItemSubTasksConnection!
}

input CursorPaging {
"""Paginate before opaque cursor"""
before: ConnectionCursor

"""Paginate after opaque cursor"""
after: ConnectionCursor

"""Paginate first"""
first: Int

"""Paginate last"""
last: Int
}

"""Cursor for paging through collections"""
scalar ConnectionCursor

input SubTaskFilter {
and: [SubTaskFilter!]
or: [SubTaskFilter!]
id: IDFilterComparison
title: StringFieldComparison
description: StringFieldComparison
completed: BooleanFieldComparison
created: DateFieldComparison
updated: DateFieldComparison
todoItemId: NumberFieldComparison
}

input IDFilterComparison {
is: Boolean
isNot: Boolean
eq: ID
neq: ID
gt: ID
gte: ID
lt: ID
lte: ID
like: ID
notLike: ID
iLike: ID
notILike: ID
in: [ID!]
notIn: [ID!]
}

input StringFieldComparison {
is: Boolean
isNot: Boolean
eq: String
neq: String
gt: String
gte: String
lt: String
lte: String
like: String
notLike: String
iLike: String
notILike: String
in: [String!]
notIn: [String!]
}

input BooleanFieldComparison {
is: Boolean
isNot: Boolean
}

input DateFieldComparison {
is: Boolean
isNot: Boolean
eq: DateTime
neq: DateTime
gt: DateTime
gte: DateTime
lt: DateTime
lte: DateTime
in: [DateTime!]
notIn: [DateTime!]
between: DateFieldComparisonBetween
notBetween: DateFieldComparisonBetween
}

"""
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
"""
scalar DateTime

input DateFieldComparisonBetween {
lower: DateTime!
upper: DateTime!
}

input NumberFieldComparison {
is: Boolean
isNot: Boolean
eq: Float
neq: Float
gt: Float
gte: Float
lt: Float
lte: Float
in: [Float!]
notIn: [Float!]
between: NumberFieldComparisonBetween
notBetween: NumberFieldComparisonBetween
}

input NumberFieldComparisonBetween {
lower: Float!
upper: Float!
}

input SubTaskSort {
field: SubTaskSortFields!
direction: SortDirection!
nulls: SortNulls
}

enum SubTaskSortFields {
id
title
description
completed
created
updated
todoItemId
}

"""Sort Directions"""
enum SortDirection {
ASC
DESC
}

"""Sort Nulls Options"""
enum SortNulls {
NULLS_FIRST
NULLS_LAST
}

type SubTask {
id: ID!
title: String!
description: String
completed: Boolean!
created: DateTime!
updated: DateTime!
todoItemId: Float!
todoItem: TodoItem!
}

type DeleteManyResponse {
"""The number of records deleted."""
deletedCount: Int!
}

type SubTaskDeleteResponse {
id: ID
title: String
description: String
completed: Boolean
created: DateTime
updated: DateTime
todoItemId: Float
}

type UpdateManyResponse {
"""The number of records updated."""
updatedCount: Int!
}

type SubTaskEdge {
"""The node containing the SubTask"""
node: SubTask!

"""Cursor for this node."""
cursor: ConnectionCursor!
}

type PageInfo {
"""true if paging forward and there are more records."""
hasNextPage: Boolean

"""true if paging backwards and there are more records."""
hasPreviousPage: Boolean

"""The cursor of the first returned record."""
startCursor: ConnectionCursor

"""The cursor of the last returned record."""
endCursor: ConnectionCursor
}

type SubTaskConnection {
"""Paging information"""
pageInfo: PageInfo!

"""Array of edges."""
edges: [SubTaskEdge!]!
}

type TodoItemSubTasksConnection {
"""Paging information"""
pageInfo: PageInfo!

"""Array of edges."""
edges: [SubTaskEdge!]!
}

type Query {
subTask(
"""The id of the record to find."""
id: ID!
): SubTask!
subTasks(
"""Limit or page results."""
paging: CursorPaging! = {first: 10}

"""Specify to filter the records returned."""
filter: SubTaskFilter! = {}

"""Specify to sort results."""
sorting: [SubTaskSort!]! = []
): SubTaskConnection!
}

type Mutation {
createOneSubTask(input: CreateOneSubTaskInput!): SubTask!
createManySubTasks(input: CreateManySubTasksInput!): [SubTask!]!
updateOneSubTask(input: UpdateOneSubTaskInput!): SubTask!
updateManySubTasks(input: UpdateManySubTasksInput!): UpdateManyResponse!
deleteOneSubTask(input: DeleteOneSubTaskInput!): SubTaskDeleteResponse!
deleteManySubTasks(input: DeleteManySubTasksInput!): DeleteManyResponse!
}

input CreateOneSubTaskInput {
"""The record to create"""
subTask: SubTaskInput!
}

input SubTaskInput {
title: String!
description: String
completed: Boolean!
todoItemId: ID!
}

input CreateManySubTasksInput {
"""Array of records to create"""
subTasks: [SubTaskInput!]!
}

input UpdateOneSubTaskInput {
"""The id of the record to update"""
id: ID!

"""The update to apply."""
update: SubTaskUpdate!
}

input SubTaskUpdate {
title: String!
description: String
completed: Boolean
todoItemId: Float
}

input UpdateManySubTasksInput {
"""Filter used to find fields to update"""
filter: SubTaskUpdateFilter!

"""The update to apply to all records found using the filter"""
update: SubTaskUpdate!
}

input SubTaskUpdateFilter {
and: [SubTaskUpdateFilter!]
or: [SubTaskUpdateFilter!]
id: IDFilterComparison
title: StringFieldComparison
description: StringFieldComparison
completed: BooleanFieldComparison
created: DateFieldComparison
updated: DateFieldComparison
todoItemId: NumberFieldComparison
}

input DeleteOneSubTaskInput {
"""The id of the record to delete."""
id: ID!
}

input DeleteManySubTasksInput {
"""Filter to find records to delete"""
filter: SubTaskDeleteFilter!
}

input SubTaskDeleteFilter {
and: [SubTaskDeleteFilter!]
or: [SubTaskDeleteFilter!]
id: IDFilterComparison
title: StringFieldComparison
description: StringFieldComparison
completed: BooleanFieldComparison
created: DateFieldComparison
updated: DateFieldComparison
todoItemId: NumberFieldComparison
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { SubTaskModule } from './sub-task/sub-task.module'
GraphQLModule.forRoot({
driver: ApolloFederationDriver,
autoSchemaFile: {
federation: 2
federation: 2,
path: 'examples/federation-v2/sub-task-graphql/schema.gql'
}
}),
SubTaskModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TodoItemReferenceDTO } from '../src/tag/dto/todo-item-reference.dto'
import { refresh } from './fixtures'
import { edgeNodes, pageInfoField, tagFields, todoItemFields } from './graphql-fragments'

describe('Federated - TagResolver (e2e)', () => {
describe('Federated v2 - TagResolver (e2e)', () => {
let app: INestApplication

beforeAll(async () => {
Expand Down
Loading

0 comments on commit d96f9a3

Please sign in to comment.