Skip to content
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json

# Runtime data
pids
Expand Down Expand Up @@ -60,3 +61,6 @@ typings/
# next.js build output
.next
/dist

# editor config
.vscode
20 changes: 20 additions & 0 deletions src/__tests__/__snapshots__/schema-base.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ input ItemCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in selecting a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: [ID]
}

\\"\\"\\"An input for mutations affecting \`Item\`\\"\\"\\"
Expand All @@ -316,6 +319,8 @@ input ItemInput {
personIdentifier: String
label: String!
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand All @@ -326,6 +331,8 @@ input ItemPatch {
personIdentifier: String
label: String
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand Down Expand Up @@ -730,6 +737,11 @@ input PersonCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in selecting a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: [ID]
}

\\"\\"\\"An input for mutations affecting \`Person\`\\"\\"\\"
Expand All @@ -738,6 +750,10 @@ input PersonInput {
identifier: String!
name: String!
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand All @@ -749,6 +765,10 @@ input PersonPatch {
identifier: String
name: String
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ input ItemCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in selecting a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: [ID]
}

\\"\\"\\"An input for mutations affecting \`Item\`\\"\\"\\"
Expand All @@ -316,6 +319,8 @@ input ItemInput {
personIdentifier: String
label: String!
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand All @@ -326,6 +331,8 @@ input ItemPatch {
personIdentifier: String
label: String
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand Down Expand Up @@ -730,6 +737,11 @@ input PersonCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in selecting a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: [ID]
}

\\"\\"\\"An input for mutations affecting \`Person\`\\"\\"\\"
Expand All @@ -738,6 +750,10 @@ input PersonInput {
identifier: String!
name: String!
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand All @@ -749,6 +765,10 @@ input PersonPatch {
identifier: String
name: String
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ input ItemCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in selecting a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: [ID]
}

\\"\\"\\"An input for mutations affecting \`Item\`\\"\\"\\"
Expand All @@ -316,6 +319,8 @@ input ItemInput {
personIdentifier: String
label: String!
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand All @@ -326,6 +331,8 @@ input ItemPatch {
personIdentifier: String
label: String
createdAt: Datetime

\\"\\"\\"The globally unique \`ID\` to be used in specifying a single \`Person\`.\\"\\"\\"
personByPersonOrganizationIdAndPersonIdentifier: ID
}

Expand Down Expand Up @@ -730,6 +737,11 @@ input PersonCondition {

\\"\\"\\"Checks for equality with the object’s \`createdAt\` field.\\"\\"\\"
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in selecting a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: [ID]
}

\\"\\"\\"An input for mutations affecting \`Person\`\\"\\"\\"
Expand All @@ -738,6 +750,10 @@ input PersonInput {
identifier: String!
name: String!
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand All @@ -749,6 +765,10 @@ input PersonPatch {
identifier: String
name: String
createdAt: Datetime

\\"\\"\\"
The globally unique \`ID\` to be used in specifying a single \`Organization\`.
\\"\\"\\"
organizationByOrganizationId: ID
}

Expand Down
45 changes: 45 additions & 0 deletions src/__tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,51 @@ Object {
"personIdentifier": "3",
"personOrganizationId": 2,
}
`);

const queryResult = await graphql(
schema,
`
query {
allItems(condition: {
personByPersonOrganizationIdAndPersonIdentifier: [
"WyJwZW9wbGUiLDIsIjMiXQ=="
]
}) {
nodes {
personByPersonOrganizationIdAndPersonIdentifier {
nodeId
organizationId
identifier
}
personOrganizationId
personIdentifier
label
}
}
}
`,
null,
context,
{},
null
);
expect(queryResult.errors).toBeFalsy();
expect(queryResult.data).toBeTruthy();
const {
allItems: { nodes }
} = queryResult.data!;
expect(nodes[0]).toMatchInlineSnapshot(`
Object {
"label": "Gadget",
"personByPersonOrganizationIdAndPersonIdentifier": Object {
"identifier": "3",
"nodeId": "WyJwZW9wbGUiLDIsIjMiXQ==",
"organizationId": 2,
},
"personIdentifier": "3",
"personOrganizationId": 2,
}
`);

const unsetResult = await graphql(
Expand Down
Loading