2020-01-23 09:17:17 +08:00
// Jest Snapshot v1, https://goo.gl/fbAQLP
2020-10-21 02:29:35 +08:00
exports[`basic behavior can define custom resolve 1`] = `
2020-01-23 09:17:17 +08:00
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=",
},
},
},
}
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior can define custom resolve, supplying nodes directly 1`] = `
2020-01-23 09:17:17 +08:00
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=",
},
},
},
}
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior can define custom resolve, which will derive nodes if includeNodesField is true 1`] = `
2020-01-23 09:17:17 +08:00
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=",
},
},
},
}
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior resolves any promises in nodes 1`] = `
2020-01-23 09:17:17 +08:00
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=",
2020-07-02 04:16:09 +08:00
"hasNextPage": false,
2020-01-23 09:17:17 +08:00
"hasPreviousPage": false,
"startCursor": "Y3Vyc29yOjA=",
},
},
},
}
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior should adhere to the Relay spec 1`] = `
2020-01-23 09:17:17 +08:00
"type UserConnection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-01-23 09:17:17 +08:00
edges: [UserEdge]
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
}"
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior should adhere to the Relay spec 2`] = `
2020-01-23 09:17:17 +08:00
"type UserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-01-23 09:17:17 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-01-23 09:17:17 +08:00
node: User
}"
`;
2020-10-21 02:29:35 +08:00
exports[`basic behavior should adhere to the Relay spec 3`] = `
2020-01-23 09:17:17 +08:00
"\\"\\"\\"
2022-05-03 23:24:45 +08:00
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
2020-01-23 09:17:17 +08:00
\\"\\"\\"
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
}"
`;
2020-11-26 04:09:30 +08:00
exports[`field level configuration #515 - custom non-string cursor type 1`] = `
2020-11-28 03:22:48 +08:00
"\\"\\"\\"
2022-05-03 23:24:45 +08:00
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
2020-11-28 03:22:48 +08:00
\\"\\"\\"
type PageInfo {
\\"\\"\\"
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
\\"\\"\\"
endCursor: String
2020-11-26 04:09:30 +08:00
2020-11-28 03:22:48 +08:00
\\"\\"\\"
Used to indicate whether more edges exist following the set defined by the clients arguments.
\\"\\"\\"
hasNextPage: Boolean!
2020-11-26 04:09:30 +08:00
2020-11-28 03:22:48 +08:00
\\"\\"\\"
Used to indicate whether more edges exist prior to the set defined by the clients arguments.
\\"\\"\\"
hasPreviousPage: Boolean!
2020-11-26 04:09:30 +08:00
2020-11-28 03:22:48 +08:00
\\"\\"\\"
The cursor corresponding to the first nodes in edges. Null if the connection is empty.
\\"\\"\\"
startCursor: String
}
type Query {
fieldLevel(
2020-11-26 04:09:30 +08:00
\\"\\"\\"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
2020-11-28 03:22:48 +08:00
2020-11-26 04:09:30 +08:00
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
first: Int
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
last: Int
2020-11-28 03:22:48 +08:00
): QueryFieldLevel_Connection!
fieldLevel2(
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
after: String
2020-11-26 04:09:30 +08:00
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
before: String
2020-11-28 03:22:48 +08:00
2020-11-26 04:09:30 +08:00
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
first: Int
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
last: Int
2020-11-28 03:22:48 +08:00
): QueryFieldLevel2_Connection!
pluginLevel(
\\"\\"\\"Returns the elements in the list that come after the specified cursor\\"\\"\\"
after: String
2020-11-26 04:09:30 +08:00
\\"\\"\\"Returns the elements in the list that come before the specified cursor\\"\\"\\"
before: String
2020-11-28 03:22:48 +08:00
\\"\\"\\"Returns the first n elements from the list.\\"\\"\\"
first: Int
2020-11-26 04:09:30 +08:00
2020-11-28 03:22:48 +08:00
\\"\\"\\"Returns the last n elements from the list.\\"\\"\\"
last: Int
): UserConnection!
2020-11-26 04:09:30 +08:00
}
2022-02-18 01:47:40 +08:00
type QueryFieldLevel2_Connection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2022-02-18 01:47:40 +08:00
edges: [QueryFieldLevel2_Edge!]!
2020-11-26 04:09:30 +08:00
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-11-26 04:09:30 +08:00
pageInfo: PageInfo!
}
2022-02-18 01:47:40 +08:00
type QueryFieldLevel2_Edge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2022-02-18 01:47:40 +08:00
cursor: UUID4!
2020-11-28 03:22:48 +08:00
delta: Int!
2020-11-26 04:09:30 +08:00
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-11-26 04:09:30 +08:00
node: User!
}
2022-02-18 01:47:40 +08:00
type QueryFieldLevel_Connection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2022-02-18 01:47:40 +08:00
edges: [QueryFieldLevel_Edge!]!
2020-11-26 04:09:30 +08:00
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-11-26 04:09:30 +08:00
pageInfo: PageInfo!
}
2022-02-18 01:47:40 +08:00
type QueryFieldLevel_Edge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2022-02-18 01:47:40 +08:00
cursor: UUID!
2020-11-28 03:22:48 +08:00
delta: Int!
2020-11-26 04:09:30 +08:00
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-11-26 04:09:30 +08:00
node: User!
}
2022-02-18 01:47:40 +08:00
scalar UUID
scalar UUID4
2020-11-26 04:09:30 +08:00
type User {
id: ID!
name: String!
}
2020-11-25 22:49:27 +08:00
type UserConnection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-11-25 22:49:27 +08:00
edges: [UserEdge!]!
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-11-25 22:49:27 +08:00
pageInfo: PageInfo!
}
type UserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-11-28 03:22:48 +08:00
cursor: UUID!
delta: Int!
2020-11-25 22:49:27 +08:00
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-11-25 22:49:27 +08:00
node: User!
2022-02-18 01:47:40 +08:00
}"
2020-11-28 03:22:48 +08:00
`;
exports[`field level configuration #670 should explicitly state nullability for connectionPlugin args & fields 1`] = `
"\\"\\"\\"
2022-05-03 23:24:45 +08:00
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
2020-11-25 22:49:27 +08:00
\\"\\"\\"
type PageInfo {
2020-11-28 03:22:48 +08:00
\\"\\"\\"
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
\\"\\"\\"
endCursor: String
2020-11-25 22:49:27 +08:00
\\"\\"\\"
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
2020-11-28 03:22:48 +08:00
}
2020-11-25 22:49:27 +08:00
2020-11-28 03:22:48 +08:00
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!
2020-11-25 22:49:27 +08:00
}
type User {
id: ID!
name: String!
}
2020-11-28 03:22:48 +08:00
type UserConnection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-11-28 03:22:48 +08:00
edges: [UserEdge!]!
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-11-28 03:22:48 +08:00
pageInfo: PageInfo!
}
type UserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-11-28 03:22:48 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-11-28 03:22:48 +08:00
node: User!
2022-02-18 01:47:40 +08:00
}"
2020-11-25 22:49:27 +08:00
`;
2021-01-07 11:08:40 +08:00
exports[`field level configuration can configure connection names per-instance 1`] = `"QueryUsersTestFieldConnection"`;
exports[`field level configuration can configure edge names per-instance 1`] = `"QueryUsersTestFieldEdge"`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can configure the connection per-instance 1`] = `
2020-01-23 09:17:17 +08:00
"type QueryUsers_Connection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-01-23 09:17:17 +08:00
edges: [UserEdge]
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
totalCount: Int
}"
`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can configure the edge per-instance 1`] = `
2020-01-23 09:17:17 +08:00
"type QueryUsers_Connection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-01-23 09:17:17 +08:00
edges: [QueryUsers_Edge]
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
}"
`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can configure the edge per-instance 2`] = `
2020-01-23 09:17:17 +08:00
"type QueryUsers_Edge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-01-23 09:17:17 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-01-23 09:17:17 +08:00
node: User
role: String
}"
`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can define a schema with multiple plugins, and separate them by typePrefix 1`] = `
2020-11-28 03:22:48 +08:00
"type AnalyticsUserConnection {
averageCount: Int
2020-08-08 04:12:15 +08:00
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-11-28 03:22:48 +08:00
edges: [AnalyticsUserEdge]
2020-01-23 09:17:17 +08:00
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
2020-11-28 03:22:48 +08:00
totalCount: Int
2020-01-23 09:17:17 +08:00
}
2020-11-28 03:22:48 +08:00
type AnalyticsUserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-01-23 09:17:17 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-01-23 09:17:17 +08:00
node: User
}
\\"\\"\\"
2022-05-03 23:24:45 +08:00
PageInfo cursor, as defined in https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
2020-01-23 09:17:17 +08:00
\\"\\"\\"
type PageInfo {
2020-11-28 03:22:48 +08:00
\\"\\"\\"
The cursor corresponding to the last nodes in edges. Null if the connection is empty.
\\"\\"\\"
endCursor: String
2020-01-23 09:17:17 +08:00
\\"\\"\\"
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
2020-11-28 03:22:48 +08:00
}
2020-01-23 09:17:17 +08:00
2020-11-28 03:22:48 +08:00
type Query {
2022-02-18 01:47:40 +08:00
userStats(
2020-11-28 03:22:48 +08:00
\\"\\"\\"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
2022-02-18 01:47:40 +08:00
): AnalyticsUserConnection
users(
2020-11-28 03:22:48 +08:00
\\"\\"\\"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
2022-02-18 01:47:40 +08:00
): UserConnection
2020-01-23 09:17:17 +08:00
}
2020-11-28 03:22:48 +08:00
type User {
id: ID
name: String
}
type UserConnection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-11-28 03:22:48 +08:00
edges: [UserEdge]
2020-01-23 09:17:17 +08:00
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
}
2020-11-28 03:22:48 +08:00
type UserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-01-23 09:17:17 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-01-23 09:17:17 +08:00
node: User
2022-02-18 01:47:40 +08:00
}"
2020-01-23 09:17:17 +08:00
`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can define additional args for the connection 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`field level configuration can inherit the additional args from the main config 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-11-25 00:40:55 +08:00
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
"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration allows disabling backward pagination 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration allows disabling backward pagination w/ strictArgs: false to make \`first\` nullable 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration allows disabling forward pagination 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration allows disabling forward pagination w/ strictArgs:false to make \`last\` nullable 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration can configure additional fields for the connection globally 1`] = `
2020-01-23 09:17:17 +08:00
"type UserConnection {
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Edge-Types\\"\\"\\"
2020-01-23 09:17:17 +08:00
edges: [UserEdge]
2022-05-03 23:38:57 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo\\"\\"\\"
2020-01-23 09:17:17 +08:00
pageInfo: PageInfo!
totalCount: Int
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration can configure additional fields for the edge globally 1`] = `
2020-01-23 09:17:17 +08:00
"type UserEdge {
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Cursor\\"\\"\\"
2020-01-23 09:17:17 +08:00
cursor: String!
2022-05-03 23:24:45 +08:00
\\"\\"\\"https://relay.dev/graphql/connections.htm#sec-Node\\"\\"\\"
2020-01-23 09:17:17 +08:00
node: User
createdAt: String
}"
`;
2021-01-07 11:08:40 +08:00
exports[`global plugin configuration can configure connection names globally 1`] = `"QueryUsersTestGlobalConnection"`;
exports[`global plugin configuration can configure edge names globally 1`] = `"QueryUsersTestGlobalEdge"`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration can define additional args for all connections 1`] = `
2020-01-23 09:17:17 +08:00
"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
2020-12-08 06:02:36 +08:00
ok(ok: Boolean): Boolean
2020-01-23 09:17:17 +08:00
}"
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration can include a "nodes" field, with an array of nodes 1`] = `"UserConnection"`;
2020-01-23 09:17:17 +08:00
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration logs error if the extendConnection resolver is not specified 1`] = `
2020-01-23 09:17:17 +08:00
Array [
2020-11-26 04:44:29 +08:00
[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.],
2020-01-23 09:17:17 +08:00
]
`;
2020-10-21 02:29:35 +08:00
exports[`global plugin configuration logs error if the extendEdge resolver is not specified 1`] = `
2020-01-23 09:17:17 +08:00
Array [
2020-11-26 04:44:29 +08:00
[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.],
2020-01-23 09:17:17 +08:00
]
`;