-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql, #586): Allow overriding endpoint name
- Loading branch information
1 parent
5a992e4
commit 1634e71
Showing
18 changed files
with
722 additions
and
12 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...phql/__tests__/resolvers/__fixtures__/create/create-custom-many-mutation.resolver.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type TestResolverDTO { | ||
id: ID! | ||
stringField: String! | ||
} | ||
|
||
type Query { | ||
test: TestResolverDTO! | ||
} | ||
|
||
type Mutation { | ||
createOneTestResolverDTO(input: CreateOneTestResolverDTOInput!): TestResolverDTO! | ||
create_many_test(input: CreateManyTestResolverDTOSInput!): [TestResolverDTO!]! | ||
} | ||
|
||
input CreateOneTestResolverDTOInput { | ||
"""The record to create""" | ||
testResolverDTO: CreateTestResolverDTO! | ||
} | ||
|
||
input CreateTestResolverDTO { | ||
id: ID | ||
stringField: String | ||
} | ||
|
||
input CreateManyTestResolverDTOSInput { | ||
"""Array of records to create""" | ||
testResolverDTOS: [CreateTestResolverDTO!]! | ||
} |
28 changes: 28 additions & 0 deletions
28
...aphql/__tests__/resolvers/__fixtures__/create/create-custom-one-mutation.resolver.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type TestResolverDTO { | ||
id: ID! | ||
stringField: String! | ||
} | ||
|
||
type Query { | ||
test: TestResolverDTO! | ||
} | ||
|
||
type Mutation { | ||
create_one_test(input: CreateOneTestResolverDTOInput!): TestResolverDTO! | ||
createManyTestResolverDTOS(input: CreateManyTestResolverDTOSInput!): [TestResolverDTO!]! | ||
} | ||
|
||
input CreateOneTestResolverDTOInput { | ||
"""The record to create""" | ||
testResolverDTO: CreateTestResolverDTO! | ||
} | ||
|
||
input CreateTestResolverDTO { | ||
id: ID | ||
stringField: String | ||
} | ||
|
||
input CreateManyTestResolverDTOSInput { | ||
"""Array of records to create""" | ||
testResolverDTOS: [CreateTestResolverDTO!]! | ||
} |
74 changes: 74 additions & 0 deletions
74
...phql/__tests__/resolvers/__fixtures__/delete/delete-custom-many-mutation.resolver.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
type TestResolverDTO { | ||
id: ID! | ||
stringField: String! | ||
} | ||
|
||
type DeleteManyResponse { | ||
"""The number of records deleted.""" | ||
deletedCount: Int! | ||
} | ||
|
||
type TestResolverDTODeleteResponse { | ||
id: ID | ||
stringField: String | ||
} | ||
|
||
type Query { | ||
test: TestResolverDTO! | ||
} | ||
|
||
type Mutation { | ||
deleteOneTestResolverDTO(input: DeleteOneInput!): TestResolverDTODeleteResponse! | ||
delete_many_test(input: DeleteManyTestResolverDTOSInput!): DeleteManyResponse! | ||
} | ||
|
||
input DeleteOneInput { | ||
"""The id of the record to delete.""" | ||
id: ID! | ||
} | ||
|
||
input DeleteManyTestResolverDTOSInput { | ||
"""Filter to find records to delete""" | ||
filter: TestResolverDTODeleteFilter! | ||
} | ||
|
||
input TestResolverDTODeleteFilter { | ||
and: [TestResolverDTODeleteFilter!] | ||
or: [TestResolverDTODeleteFilter!] | ||
id: IDFilterComparison | ||
stringField: StringFieldComparison | ||
} | ||
|
||
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!] | ||
} |
74 changes: 74 additions & 0 deletions
74
...aphql/__tests__/resolvers/__fixtures__/delete/delete-custom-one-mutation.resolver.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
type TestResolverDTO { | ||
id: ID! | ||
stringField: String! | ||
} | ||
|
||
type DeleteManyResponse { | ||
"""The number of records deleted.""" | ||
deletedCount: Int! | ||
} | ||
|
||
type TestResolverDTODeleteResponse { | ||
id: ID | ||
stringField: String | ||
} | ||
|
||
type Query { | ||
test: TestResolverDTO! | ||
} | ||
|
||
type Mutation { | ||
delete_one_test(input: DeleteOneInput!): TestResolverDTODeleteResponse! | ||
deleteManyTestResolverDTOS(input: DeleteManyTestResolverDTOSInput!): DeleteManyResponse! | ||
} | ||
|
||
input DeleteOneInput { | ||
"""The id of the record to delete.""" | ||
id: ID! | ||
} | ||
|
||
input DeleteManyTestResolverDTOSInput { | ||
"""Filter to find records to delete""" | ||
filter: TestResolverDTODeleteFilter! | ||
} | ||
|
||
input TestResolverDTODeleteFilter { | ||
and: [TestResolverDTODeleteFilter!] | ||
or: [TestResolverDTODeleteFilter!] | ||
id: IDFilterComparison | ||
stringField: StringFieldComparison | ||
} | ||
|
||
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!] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
...ery-graphql/__tests__/resolvers/__fixtures__/read/read-custom-many-query.resolver.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
type TestResolverDTO { | ||
id: ID! | ||
stringField: String! | ||
} | ||
|
||
type TestResolverDTOEdge { | ||
"""The node containing the TestResolverDTO""" | ||
node: TestResolverDTO! | ||
|
||
"""Cursor for this node.""" | ||
cursor: ConnectionCursor! | ||
} | ||
|
||
"""Cursor for paging through collections""" | ||
scalar 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 TestResolverDTOConnection { | ||
"""Paging information""" | ||
pageInfo: PageInfo! | ||
|
||
"""Array of edges.""" | ||
edges: [TestResolverDTOEdge!]! | ||
} | ||
|
||
type Query { | ||
testResolverDTO( | ||
"""The id of the record to find.""" | ||
id: ID! | ||
): TestResolverDTO | ||
read_many_test( | ||
"""Limit or page results.""" | ||
paging: CursorPaging = {first: 10} | ||
|
||
"""Specify to filter the records returned.""" | ||
filter: TestResolverDTOFilter = {} | ||
|
||
"""Specify to sort results.""" | ||
sorting: [TestResolverDTOSort!] = [] | ||
): TestResolverDTOConnection! | ||
test: TestResolverDTO! | ||
} | ||
|
||
input CursorPaging { | ||
"""Paginate before opaque cursor""" | ||
before: ConnectionCursor | ||
|
||
"""Paginate after opaque cursor""" | ||
after: ConnectionCursor | ||
|
||
"""Paginate first""" | ||
first: Int | ||
|
||
"""Paginate last""" | ||
last: Int | ||
} | ||
|
||
input TestResolverDTOFilter { | ||
and: [TestResolverDTOFilter!] | ||
or: [TestResolverDTOFilter!] | ||
id: IDFilterComparison | ||
stringField: StringFieldComparison | ||
} | ||
|
||
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 TestResolverDTOSort { | ||
field: TestResolverDTOSortFields! | ||
direction: SortDirection! | ||
nulls: SortNulls | ||
} | ||
|
||
enum TestResolverDTOSortFields { | ||
id | ||
stringField | ||
} | ||
|
||
"""Sort Directions""" | ||
enum SortDirection { | ||
ASC | ||
DESC | ||
} | ||
|
||
"""Sort Nulls Options""" | ||
enum SortNulls { | ||
NULLS_FIRST | ||
NULLS_LAST | ||
} |
Oops, something went wrong.