Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# The composable `filter` narrows results to the caller's authorized specs.
# Alice reads all of aliceCo/, so `startsWith` returns her whole shared
# subtree and `in` matches both of its entries. Bob reads aliceCo/shared/ via
# a role grant, so he sees the same shared subtree but the `in` entry for
# Alice's private capture is dropped rather than erroring.
query LiveSpecsFilterCatalogName {
startsWith: liveSpecs(
filter: { catalogName: { startsWith: "aliceCo/shared/" } }
) {
edges {
node {
catalogName
userCapability
}
}
}
inSet: liveSpecs(
filter: {
catalogName: {
in: [
"aliceCo/shared/a"
"aliceCo/private/capture"
"bobCo/does-not-exist"
]
}
}
) {
edges {
node {
catalogName
userCapability
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
source: crates/agent/src/integration_tests/graphql/queries/mod.rs
expression: alice_result
---
{
"inSet": {
"edges": [
{
"node": {
"catalogName": "aliceCo/private/capture",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/a",
"userCapability": "admin"
}
}
]
},
"startsWith": {
"edges": [
{
"node": {
"catalogName": "aliceCo/shared/a",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/b",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/c",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/capture",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/disabled",
"userCapability": "admin"
}
},
{
"node": {
"catalogName": "aliceCo/shared/materialize",
"userCapability": "admin"
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
source: crates/agent/src/integration_tests/graphql/queries/mod.rs
expression: alice_result
---
"GraphQL query failed with error: GraphQL errors: [ServerError { message: \"must provide at least one of `names` or `prefix`\", locations: [Pos(2:5)], path: [Field(\"liveSpecs\")], extensions: None }]"
"GraphQL query failed with error: GraphQL errors: [ServerError { message: \"must provide at least one of `names` or `prefix`, or omit `by` entirely\", locations: [Pos(2:5)], path: [Field(\"liveSpecs\")], extensions: None }]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
source: crates/agent/src/integration_tests/graphql/queries/mod.rs
expression: bob_result
---
{
"inSet": {
"edges": [
{
"node": {
"catalogName": "aliceCo/shared/a",
"userCapability": "read"
}
}
]
},
"startsWith": {
"edges": [
{
"node": {
"catalogName": "aliceCo/shared/a",
"userCapability": "read"
}
},
{
"node": {
"catalogName": "aliceCo/shared/b",
"userCapability": "read"
}
},
{
"node": {
"catalogName": "aliceCo/shared/c",
"userCapability": "read"
}
},
{
"node": {
"catalogName": "aliceCo/shared/capture",
"userCapability": "read"
}
},
{
"node": {
"catalogName": "aliceCo/shared/disabled",
"userCapability": "read"
}
},
{
"node": {
"catalogName": "aliceCo/shared/materialize",
"userCapability": "read"
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
source: crates/agent/src/integration_tests/graphql/queries/mod.rs
expression: bob_result
---
"GraphQL query failed with error: GraphQL errors: [ServerError { message: \"must provide at least one of `names` or `prefix`\", locations: [Pos(2:5)], path: [Field(\"liveSpecs\")], extensions: None }]"
"GraphQL query failed with error: GraphQL errors: [ServerError { message: \"must provide at least one of `names` or `prefix`, or omit `by` entirely\", locations: [Pos(2:5)], path: [Field(\"liveSpecs\")], extensions: None }]"
Loading
Loading