729 lines
20 KiB
Plaintext
729 lines
20 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`basic behavior can define custom resolve 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"users": Object {
|
|
"edges": Array [
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
"node": Object {
|
|
"id": "User:1",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"node": Object {
|
|
"id": "User:2",
|
|
},
|
|
},
|
|
],
|
|
"pageInfo": Object {
|
|
"endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"hasNextPage": true,
|
|
"hasPreviousPage": false,
|
|
"startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
`;
|
|
|
|
exports[`basic behavior can define custom resolve, supplying nodes directly 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"users": Object {
|
|
"edges": Array [
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
"node": Object {
|
|
"id": "User:1",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"node": Object {
|
|
"id": "User:2",
|
|
},
|
|
},
|
|
],
|
|
"nodes": Array [
|
|
Object {
|
|
"id": "User:1",
|
|
},
|
|
Object {
|
|
"id": "User:2",
|
|
},
|
|
],
|
|
"pageInfo": Object {
|
|
"endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"hasNextPage": true,
|
|
"hasPreviousPage": false,
|
|
"startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
`;
|
|
|
|
exports[`basic behavior can define custom resolve, which will derive nodes if includeNodesField is true 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"users": Object {
|
|
"edges": Array [
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
"node": Object {
|
|
"id": "User:1",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"node": Object {
|
|
"id": "User:2",
|
|
},
|
|
},
|
|
],
|
|
"nodes": Array [
|
|
Object {
|
|
"id": "User:1",
|
|
},
|
|
Object {
|
|
"id": "User:2",
|
|
},
|
|
],
|
|
"pageInfo": Object {
|
|
"endCursor": "YXJyYXljb25uZWN0aW9uOjE=",
|
|
"hasNextPage": true,
|
|
"hasPreviousPage": false,
|
|
"startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
`;
|
|
|
|
exports[`basic behavior resolves any promises in nodes 1`] = `
|
|
Object {
|
|
"data": Object {
|
|
"users": Object {
|
|
"edges": Array [
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjA=",
|
|
"node": Object {
|
|
"id": "User:1",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjE=",
|
|
"node": Object {
|
|
"id": "User:2",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjI=",
|
|
"node": Object {
|
|
"id": "User:3",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjM=",
|
|
"node": Object {
|
|
"id": "User:4",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjQ=",
|
|
"node": Object {
|
|
"id": "User:5",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjU=",
|
|
"node": Object {
|
|
"id": "User:6",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjY=",
|
|
"node": Object {
|
|
"id": "User:7",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjc=",
|
|
"node": Object {
|
|
"id": "User:8",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjg=",
|
|
"node": Object {
|
|
"id": "User:9",
|
|
},
|
|
},
|
|
Object {
|
|
"cursor": "Y3Vyc29yOjk=",
|
|
"node": Object {
|
|
"id": "User:10",
|
|
},
|
|
},
|
|
],
|
|
"pageInfo": Object {
|
|
"endCursor": "Y3Vyc29yOjk=",
|
|
"hasNextPage": false,
|
|
"hasPreviousPage": false,
|
|
"startCursor": "Y3Vyc29yOjA=",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
`;
|
|
|
|
exports[`basic behavior should adhere to the Relay spec 1`] = `
|
|
"type UserConnection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}"
|
|
`;
|
|
|
|
exports[`basic behavior should adhere to the Relay spec 2`] = `
|
|
"type UserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User
|
|
}"
|
|
`;
|
|
|
|
exports[`basic behavior should adhere to the Relay spec 3`] = `
|
|
"\\"\\"\\"
|
|
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
|
|
\\"\\"\\"
|
|
type PageInfo {
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist following the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasNextPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist prior to the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasPreviousPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
The cursor corresponding to the first nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
startCursor: String
|
|
|
|
\\"\\"\\"
|
|
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
endCursor: String
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration #515 - custom non-string cursor type 1`] = `
|
|
"\\"\\"\\"
|
|
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
|
|
\\"\\"\\"
|
|
type PageInfo {
|
|
\\"\\"\\"
|
|
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
endCursor: String
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist following the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasNextPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist prior to the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasPreviousPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
The cursor corresponding to the first nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
startCursor: String
|
|
}
|
|
|
|
type Query {
|
|
fieldLevel(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): QueryFieldLevel_Connection!
|
|
fieldLevel2(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): QueryFieldLevel2_Connection!
|
|
pluginLevel(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): UserConnection!
|
|
}
|
|
|
|
type QueryFieldLevel2_Connection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [QueryFieldLevel2_Edge!]!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type QueryFieldLevel2_Edge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: UUID4!
|
|
delta: Int!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User!
|
|
}
|
|
|
|
type QueryFieldLevel_Connection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [QueryFieldLevel_Edge!]!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type QueryFieldLevel_Edge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: UUID!
|
|
delta: Int!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User!
|
|
}
|
|
|
|
scalar UUID
|
|
|
|
scalar UUID4
|
|
|
|
type User {
|
|
id: ID!
|
|
name: String!
|
|
}
|
|
|
|
type UserConnection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge!]!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type UserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: UUID!
|
|
delta: Int!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User!
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration #670 should explicitly state nullability for connectionPlugin args & fields 1`] = `
|
|
"\\"\\"\\"
|
|
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
|
|
\\"\\"\\"
|
|
type PageInfo {
|
|
\\"\\"\\"
|
|
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
endCursor: String
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist following the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasNextPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist prior to the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasPreviousPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
The cursor corresponding to the first nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
startCursor: String
|
|
}
|
|
|
|
type Query {
|
|
users(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): UserConnection!
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
name: String!
|
|
}
|
|
|
|
type UserConnection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge!]!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type UserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User!
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can configure connection names per-instance 1`] = `"QueryUsersTestFieldConnection"`;
|
|
|
|
exports[`field level configuration can configure edge names per-instance 1`] = `"QueryUsersTestFieldEdge"`;
|
|
|
|
exports[`field level configuration can configure the connection per-instance 1`] = `
|
|
"type QueryUsers_Connection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
totalCount: Int
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can configure the edge per-instance 1`] = `
|
|
"type QueryUsers_Connection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [QueryUsers_Edge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can configure the edge per-instance 2`] = `
|
|
"type QueryUsers_Edge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User
|
|
role: String
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can define a schema with multiple plugins, and separate them by typePrefix 1`] = `
|
|
"type AnalyticsUserConnection {
|
|
averageCount: Int
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [AnalyticsUserEdge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
totalCount: Int
|
|
}
|
|
|
|
type AnalyticsUserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User
|
|
}
|
|
|
|
\\"\\"\\"
|
|
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
|
|
\\"\\"\\"
|
|
type PageInfo {
|
|
\\"\\"\\"
|
|
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
endCursor: String
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist following the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasNextPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
Used to indicate whether more edges exist prior to the set defined by the clients arguments.
|
|
\\"\\"\\"
|
|
hasPreviousPage: Boolean!
|
|
|
|
\\"\\"\\"
|
|
The cursor corresponding to the first nodes in edges. Null if the connection is empty.
|
|
\\"\\"\\"
|
|
startCursor: String
|
|
}
|
|
|
|
type Query {
|
|
userStats(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): AnalyticsUserConnection
|
|
users(
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
): UserConnection
|
|
}
|
|
|
|
type User {
|
|
id: ID
|
|
name: String
|
|
}
|
|
|
|
type UserConnection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type UserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can define additional args for the connection 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"This should be included\\"\\"\\"
|
|
filter: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration can inherit the additional args from the main config 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"This should be included\\"\\"\\"
|
|
order: String!
|
|
|
|
\\"\\"\\"This should also be included\\"\\"\\"
|
|
filter: String
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`field level configuration prints the types associated with the connection plugin correctly 1`] = `
|
|
"
|
|
/**
|
|
* Adds a Relay-style connection to the type, with numerous options for configuration
|
|
*
|
|
* @see https://nexusjs.org/docs/plugins/connection
|
|
*/
|
|
connectionField<FieldName extends string>(
|
|
fieldName: FieldName,
|
|
config: connectionPluginCore.ConnectionFieldConfig<TypeName, FieldName>
|
|
): void
|
|
"
|
|
`;
|
|
|
|
exports[`global plugin configuration allows disabling backward pagination 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int!
|
|
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration allows disabling backward pagination w/ strictArgs: false to make \`first\` nullable 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration allows disabling forward pagination 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int!
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration allows disabling forward pagination w/ strictArgs:false to make \`last\` nullable 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration can configure additional fields for the connection globally 1`] = `
|
|
"type UserConnection {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
|
|
edges: [UserEdge]
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
|
|
pageInfo: PageInfo!
|
|
totalCount: Int
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration can configure additional fields for the edge globally 1`] = `
|
|
"type UserEdge {
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
|
|
cursor: String!
|
|
|
|
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
|
|
node: User
|
|
createdAt: String
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration can configure connection names globally 1`] = `"QueryUsersTestGlobalConnection"`;
|
|
|
|
exports[`global plugin configuration can configure edge names globally 1`] = `"QueryUsersTestGlobalEdge"`;
|
|
|
|
exports[`global plugin configuration can define additional args for all connections 1`] = `
|
|
"type Query {
|
|
users(
|
|
\\"\\"\\"This should be included\\"\\"\\"
|
|
order: String!
|
|
|
|
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
|
|
first: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
|
|
after: String
|
|
|
|
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
|
|
last: Int
|
|
|
|
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
|
|
before: String
|
|
): UserConnection
|
|
ok(ok: Boolean): Boolean
|
|
}"
|
|
`;
|
|
|
|
exports[`global plugin configuration can include a "nodes" field, with an array of nodes 1`] = `"UserConnection"`;
|
|
|
|
exports[`global plugin configuration logs error if the extendConnection resolver is not specified 1`] = `
|
|
Array [
|
|
[Error: Nexus Connection Plugin: Missing totalCount resolver property for Query.users. Set requireResolver to "false" on the field config if you do not need a resolver.],
|
|
]
|
|
`;
|
|
|
|
exports[`global plugin configuration logs error if the extendEdge resolver is not specified 1`] = `
|
|
Array [
|
|
[Error: Nexus Connection Plugin: Missing edgeFields.totalCount resolver property for Query.users. Set requireResolver to "false" on the edge field config if you do not need a resolver.],
|
|
]
|
|
`;
|