Skip to content

Commit 49bd527

Browse files
authored
fix: allow filtering setof functions when source table is commented as @omit all (#103)
* add test snapshots to document missing filter arg * pass table ref when building *Filter type for functions returning a setof table type * update test snapshots
1 parent 3e7c402 commit 49bd527

13 files changed

+1008
-1
lines changed

__tests__/integration/schema/__snapshots__/additionalInsensitiveOperatorsTrue.test.js.snap

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,6 +3877,66 @@ enum ParentsOrderBy {
38773877
PRIMARY_KEY_DESC
38783878
}
38793879
3880+
type Protected implements Node {
3881+
id: Int!
3882+
name: String
3883+
3884+
\\"\\"\\"
3885+
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
3886+
\\"\\"\\"
3887+
nodeId: ID!
3888+
otherId: Int
3889+
}
3890+
3891+
\\"\\"\\"
3892+
A filter to be used against \`Protected\` object types. All fields are combined with a logical ‘and.’
3893+
\\"\\"\\"
3894+
input ProtectedFilter {
3895+
\\"\\"\\"Checks for all expressions in this list.\\"\\"\\"
3896+
and: [ProtectedFilter!]
3897+
3898+
\\"\\"\\"Filter by the object’s \`id\` field.\\"\\"\\"
3899+
id: IntFilter
3900+
3901+
\\"\\"\\"Filter by the object’s \`name\` field.\\"\\"\\"
3902+
name: StringFilter
3903+
3904+
\\"\\"\\"Negates the expression.\\"\\"\\"
3905+
not: ProtectedFilter
3906+
3907+
\\"\\"\\"Checks for any expressions in this list.\\"\\"\\"
3908+
or: [ProtectedFilter!]
3909+
3910+
\\"\\"\\"Filter by the object’s \`otherId\` field.\\"\\"\\"
3911+
otherId: IntFilter
3912+
}
3913+
3914+
\\"\\"\\"A connection to a list of \`Protected\` values.\\"\\"\\"
3915+
type ProtectedsConnection {
3916+
\\"\\"\\"
3917+
A list of edges which contains the \`Protected\` and cursor to aid in pagination.
3918+
\\"\\"\\"
3919+
edges: [ProtectedsEdge!]!
3920+
3921+
\\"\\"\\"A list of \`Protected\` objects.\\"\\"\\"
3922+
nodes: [Protected]!
3923+
3924+
\\"\\"\\"Information to aid in pagination.\\"\\"\\"
3925+
pageInfo: PageInfo!
3926+
3927+
\\"\\"\\"The count of *all* \`Protected\` you could get from the connection.\\"\\"\\"
3928+
totalCount: Int
3929+
}
3930+
3931+
\\"\\"\\"A \`Protected\` edge in the connection.\\"\\"\\"
3932+
type ProtectedsEdge {
3933+
\\"\\"\\"A cursor for use in pagination.\\"\\"\\"
3934+
cursor: Cursor
3935+
3936+
\\"\\"\\"The \`Protected\` at the end of the edge.\\"\\"\\"
3937+
node: Protected
3938+
}
3939+
38803940
\\"\\"\\"The root query type which gives access points into the data universe.\\"\\"\\"
38813941
type Query implements Node {
38823942
\\"\\"\\"Reads and enables pagination through a set of \`ArrayType\`.\\"\\"\\"
@@ -4649,6 +4709,42 @@ type Query implements Node {
46494709
): Parent
46504710
parentById(id: Int!): Parent
46514711
4712+
\\"\\"\\"Reads a single \`Protected\` using its globally unique \`ID\`.\\"\\"\\"
4713+
protected(
4714+
\\"\\"\\"
4715+
The globally unique \`ID\` to be used in selecting a single \`Protected\`.
4716+
\\"\\"\\"
4717+
nodeId: ID!
4718+
): Protected
4719+
protectedById(id: Int!): Protected
4720+
4721+
\\"\\"\\"Reads and enables pagination through a set of \`Protected\`.\\"\\"\\"
4722+
protectedsByOtherId(
4723+
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
4724+
after: Cursor
4725+
4726+
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
4727+
before: Cursor
4728+
4729+
\\"\\"\\"
4730+
A filter to be used in determining which values should be returned by the collection.
4731+
\\"\\"\\"
4732+
filter: ProtectedFilter
4733+
4734+
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
4735+
first: Int
4736+
4737+
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
4738+
last: Int
4739+
4740+
\\"\\"\\"
4741+
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
4742+
based pagination. May not be used with \`last\`.
4743+
\\"\\"\\"
4744+
offset: Int
4745+
otherId: Int
4746+
): ProtectedsConnection!
4747+
46524748
\\"\\"\\"
46534749
Exposes the root query type nested one level down. This is helpful for Relay 1
46544750
which can only query top level fields if they are in a particular form.

__tests__/integration/schema/__snapshots__/allowedFieldTypes.test.js.snap

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,66 @@ enum ParentsOrderBy {
18171817
PRIMARY_KEY_DESC
18181818
}
18191819
1820+
type Protected implements Node {
1821+
id: Int!
1822+
name: String
1823+
1824+
\\"\\"\\"
1825+
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
1826+
\\"\\"\\"
1827+
nodeId: ID!
1828+
otherId: Int
1829+
}
1830+
1831+
\\"\\"\\"
1832+
A filter to be used against \`Protected\` object types. All fields are combined with a logical ‘and.’
1833+
\\"\\"\\"
1834+
input ProtectedFilter {
1835+
\\"\\"\\"Checks for all expressions in this list.\\"\\"\\"
1836+
and: [ProtectedFilter!]
1837+
1838+
\\"\\"\\"Filter by the object’s \`id\` field.\\"\\"\\"
1839+
id: IntFilter
1840+
1841+
\\"\\"\\"Filter by the object’s \`name\` field.\\"\\"\\"
1842+
name: StringFilter
1843+
1844+
\\"\\"\\"Negates the expression.\\"\\"\\"
1845+
not: ProtectedFilter
1846+
1847+
\\"\\"\\"Checks for any expressions in this list.\\"\\"\\"
1848+
or: [ProtectedFilter!]
1849+
1850+
\\"\\"\\"Filter by the object’s \`otherId\` field.\\"\\"\\"
1851+
otherId: IntFilter
1852+
}
1853+
1854+
\\"\\"\\"A connection to a list of \`Protected\` values.\\"\\"\\"
1855+
type ProtectedsConnection {
1856+
\\"\\"\\"
1857+
A list of edges which contains the \`Protected\` and cursor to aid in pagination.
1858+
\\"\\"\\"
1859+
edges: [ProtectedsEdge!]!
1860+
1861+
\\"\\"\\"A list of \`Protected\` objects.\\"\\"\\"
1862+
nodes: [Protected]!
1863+
1864+
\\"\\"\\"Information to aid in pagination.\\"\\"\\"
1865+
pageInfo: PageInfo!
1866+
1867+
\\"\\"\\"The count of *all* \`Protected\` you could get from the connection.\\"\\"\\"
1868+
totalCount: Int
1869+
}
1870+
1871+
\\"\\"\\"A \`Protected\` edge in the connection.\\"\\"\\"
1872+
type ProtectedsEdge {
1873+
\\"\\"\\"A cursor for use in pagination.\\"\\"\\"
1874+
cursor: Cursor
1875+
1876+
\\"\\"\\"The \`Protected\` at the end of the edge.\\"\\"\\"
1877+
node: Protected
1878+
}
1879+
18201880
\\"\\"\\"The root query type which gives access points into the data universe.\\"\\"\\"
18211881
type Query implements Node {
18221882
\\"\\"\\"Reads and enables pagination through a set of \`ArrayType\`.\\"\\"\\"
@@ -2589,6 +2649,42 @@ type Query implements Node {
25892649
): Parent
25902650
parentById(id: Int!): Parent
25912651
2652+
\\"\\"\\"Reads a single \`Protected\` using its globally unique \`ID\`.\\"\\"\\"
2653+
protected(
2654+
\\"\\"\\"
2655+
The globally unique \`ID\` to be used in selecting a single \`Protected\`.
2656+
\\"\\"\\"
2657+
nodeId: ID!
2658+
): Protected
2659+
protectedById(id: Int!): Protected
2660+
2661+
\\"\\"\\"Reads and enables pagination through a set of \`Protected\`.\\"\\"\\"
2662+
protectedsByOtherId(
2663+
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
2664+
after: Cursor
2665+
2666+
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
2667+
before: Cursor
2668+
2669+
\\"\\"\\"
2670+
A filter to be used in determining which values should be returned by the collection.
2671+
\\"\\"\\"
2672+
filter: ProtectedFilter
2673+
2674+
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
2675+
first: Int
2676+
2677+
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
2678+
last: Int
2679+
2680+
\\"\\"\\"
2681+
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
2682+
based pagination. May not be used with \`last\`.
2683+
\\"\\"\\"
2684+
offset: Int
2685+
otherId: Int
2686+
): ProtectedsConnection!
2687+
25922688
\\"\\"\\"
25932689
Exposes the root query type nested one level down. This is helpful for Relay 1
25942690
which can only query top level fields if they are in a particular form.

__tests__/integration/schema/__snapshots__/allowedOperators.test.js.snap

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,66 @@ enum ParentsOrderBy {
23282328
PRIMARY_KEY_DESC
23292329
}
23302330
2331+
type Protected implements Node {
2332+
id: Int!
2333+
name: String
2334+
2335+
\\"\\"\\"
2336+
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
2337+
\\"\\"\\"
2338+
nodeId: ID!
2339+
otherId: Int
2340+
}
2341+
2342+
\\"\\"\\"
2343+
A filter to be used against \`Protected\` object types. All fields are combined with a logical ‘and.’
2344+
\\"\\"\\"
2345+
input ProtectedFilter {
2346+
\\"\\"\\"Checks for all expressions in this list.\\"\\"\\"
2347+
and: [ProtectedFilter!]
2348+
2349+
\\"\\"\\"Filter by the object’s \`id\` field.\\"\\"\\"
2350+
id: IntFilter
2351+
2352+
\\"\\"\\"Filter by the object’s \`name\` field.\\"\\"\\"
2353+
name: StringFilter
2354+
2355+
\\"\\"\\"Negates the expression.\\"\\"\\"
2356+
not: ProtectedFilter
2357+
2358+
\\"\\"\\"Checks for any expressions in this list.\\"\\"\\"
2359+
or: [ProtectedFilter!]
2360+
2361+
\\"\\"\\"Filter by the object’s \`otherId\` field.\\"\\"\\"
2362+
otherId: IntFilter
2363+
}
2364+
2365+
\\"\\"\\"A connection to a list of \`Protected\` values.\\"\\"\\"
2366+
type ProtectedsConnection {
2367+
\\"\\"\\"
2368+
A list of edges which contains the \`Protected\` and cursor to aid in pagination.
2369+
\\"\\"\\"
2370+
edges: [ProtectedsEdge!]!
2371+
2372+
\\"\\"\\"A list of \`Protected\` objects.\\"\\"\\"
2373+
nodes: [Protected]!
2374+
2375+
\\"\\"\\"Information to aid in pagination.\\"\\"\\"
2376+
pageInfo: PageInfo!
2377+
2378+
\\"\\"\\"The count of *all* \`Protected\` you could get from the connection.\\"\\"\\"
2379+
totalCount: Int
2380+
}
2381+
2382+
\\"\\"\\"A \`Protected\` edge in the connection.\\"\\"\\"
2383+
type ProtectedsEdge {
2384+
\\"\\"\\"A cursor for use in pagination.\\"\\"\\"
2385+
cursor: Cursor
2386+
2387+
\\"\\"\\"The \`Protected\` at the end of the edge.\\"\\"\\"
2388+
node: Protected
2389+
}
2390+
23312391
\\"\\"\\"The root query type which gives access points into the data universe.\\"\\"\\"
23322392
type Query implements Node {
23332393
\\"\\"\\"Reads and enables pagination through a set of \`ArrayType\`.\\"\\"\\"
@@ -3100,6 +3160,42 @@ type Query implements Node {
31003160
): Parent
31013161
parentById(id: Int!): Parent
31023162
3163+
\\"\\"\\"Reads a single \`Protected\` using its globally unique \`ID\`.\\"\\"\\"
3164+
protected(
3165+
\\"\\"\\"
3166+
The globally unique \`ID\` to be used in selecting a single \`Protected\`.
3167+
\\"\\"\\"
3168+
nodeId: ID!
3169+
): Protected
3170+
protectedById(id: Int!): Protected
3171+
3172+
\\"\\"\\"Reads and enables pagination through a set of \`Protected\`.\\"\\"\\"
3173+
protectedsByOtherId(
3174+
\\"\\"\\"Read all values in the set after (below) this cursor.\\"\\"\\"
3175+
after: Cursor
3176+
3177+
\\"\\"\\"Read all values in the set before (above) this cursor.\\"\\"\\"
3178+
before: Cursor
3179+
3180+
\\"\\"\\"
3181+
A filter to be used in determining which values should be returned by the collection.
3182+
\\"\\"\\"
3183+
filter: ProtectedFilter
3184+
3185+
\\"\\"\\"Only read the first \`n\` values of the set.\\"\\"\\"
3186+
first: Int
3187+
3188+
\\"\\"\\"Only read the last \`n\` values of the set.\\"\\"\\"
3189+
last: Int
3190+
3191+
\\"\\"\\"
3192+
Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor
3193+
based pagination. May not be used with \`last\`.
3194+
\\"\\"\\"
3195+
offset: Int
3196+
otherId: Int
3197+
): ProtectedsConnection!
3198+
31033199
\\"\\"\\"
31043200
Exposes the root query type nested one level down. This is helpful for Relay 1
31053201
which can only query top level fields if they are in a particular form.

0 commit comments

Comments
 (0)