Skip to content

Commit

Permalink
[JSONSelection] Remove rest: * { a b } star selection syntax (#6185)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn authored Oct 23, 2024
1 parent d57de3e commit 82e262b
Show file tree
Hide file tree
Showing 45 changed files with 106 additions and 1,399 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type Query
@join__type(graph: GRAPHQL)
{
users: [User] @join__field(graph: CONNECTORS) @join__directive(graphs: [CONNECTORS], name: "connect", args: {source: "json", http: {GET: "/users"}, selection: "id name"})
user(id: ID!): User @join__field(graph: CONNECTORS) @join__directive(graphs: [CONNECTORS], name: "connect", args: {source: "json", http: {GET: "/users/{$args.id}"}, selection: "id\nname\nusername\nrest: *", entity: true})
user(id: ID!): User @join__field(graph: CONNECTORS) @join__directive(graphs: [CONNECTORS], name: "connect", args: {source: "json", http: {GET: "/users/{$args.id}"}, selection: "id\nname\nusername", entity: true})
}

type User
Expand All @@ -81,7 +81,6 @@ type User
id: ID!
name: String @join__field(graph: CONNECTORS)
username: String @join__field(graph: CONNECTORS)
rest: JSON @join__field(graph: CONNECTORS)
c: String @join__field(graph: CONNECTORS, external: true) @join__field(graph: GRAPHQL)
d: String @join__field(graph: CONNECTORS, requires: "c") @join__directive(graphs: [CONNECTORS], name: "connect", args: {source: "json", http: {GET: "/users/{$this.c}"}, selection: "$.phone"})
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ subgraphs:
id
name
username
rest: *
"""
entity: true
)
Expand All @@ -46,7 +45,6 @@ subgraphs:
id: ID!
name: String
username: String
rest: JSON
c: String @external
d: String
@requires(fields: "c")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ca
None,
),
],
star: None,
range: Some(
0..70,
),
Expand Down Expand Up @@ -321,7 +320,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ca
None,
),
],
star: None,
range: Some(
0..70,
),
Expand Down Expand Up @@ -415,7 +413,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ca
None,
),
],
star: None,
range: Some(
0..2,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ci
None,
),
],
star: None,
range: Some(
0..2,
),
Expand Down Expand Up @@ -171,7 +170,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ci
None,
),
],
star: None,
range: Some(
0..2,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -204,7 +203,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -301,7 +299,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -416,7 +413,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -554,7 +550,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
},
),
],
star: None,
range: Some(
0..17,
),
Expand Down Expand Up @@ -668,7 +663,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
},
),
],
star: None,
range: Some(
0..12,
),
Expand Down Expand Up @@ -704,7 +698,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -818,7 +811,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
},
),
],
star: None,
range: Some(
0..12,
),
Expand Down Expand Up @@ -895,7 +887,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ke
},
),
],
star: None,
range: Some(
0..17,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/no
None,
),
],
star: None,
range: Some(
0..4,
),
Expand Down Expand Up @@ -174,7 +173,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/no
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down
12 changes: 0 additions & 12 deletions .../src/sources/connect/expand/tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,20 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
81..92,
),
},
),
),
],
star: None,
range: Some(
49..94,
),
},
),
),
],
star: None,
range: Some(
12..96,
),
Expand Down Expand Up @@ -285,7 +282,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
0..2,
),
Expand Down Expand Up @@ -406,7 +402,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
},
),
],
star: None,
range: Some(
0..24,
),
Expand Down Expand Up @@ -442,7 +437,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
0..7,
),
Expand Down Expand Up @@ -588,15 +582,13 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
16..45,
),
},
),
),
],
star: None,
range: Some(
0..45,
),
Expand Down Expand Up @@ -808,15 +800,13 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
73..94,
),
},
),
),
],
star: None,
range: Some(
31..96,
),
Expand Down Expand Up @@ -909,15 +899,13 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/re
None,
),
],
star: None,
range: Some(
119..156,
),
},
),
),
],
star: None,
range: Some(
0..156,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/si
None,
),
],
star: None,
range: Some(
0..4,
),
Expand Down Expand Up @@ -174,7 +173,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/si
None,
),
],
star: None,
range: Some(
0..6,
),
Expand Down Expand Up @@ -301,7 +299,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/si
},
),
],
star: None,
range: Some(
0..15,
),
Expand Down
26 changes: 1 addition & 25 deletions ...rc/sources/connect/expand/tests/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/st
None,
),
],
star: None,
range: Some(
0..7,
),
Expand Down Expand Up @@ -189,31 +188,8 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/st
None,
),
],
star: Some(
StarSelection {
alias: Some(
Alias {
name: WithRange {
node: Field(
"rest",
),
range: Some(
17..21,
),
},
range: Some(
17..22,
),
},
),
selection: None,
range: Some(
17..24,
),
},
),
range: Some(
0..24,
0..16,
),
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ enum join__Graph {
GRAPHQL @join__graph(name: "graphql", url: "https://localhost:4001")
}

scalar JSON @join__type(graph: CONNECTORS_QUERY_USER_0)

type User @join__type(graph: CONNECTORS_QUERY_USER_0, key: "id") @join__type(graph: CONNECTORS_QUERY_USERS_0) @join__type(graph: CONNECTORS_USER_D_1, key: "c") @join__type(graph: GRAPHQL, key: "id") {
id: ID! @join__field(graph: CONNECTORS_QUERY_USER_0) @join__field(graph: CONNECTORS_QUERY_USERS_0) @join__field(graph: GRAPHQL)
name: String @join__field(graph: CONNECTORS_QUERY_USER_0) @join__field(graph: CONNECTORS_QUERY_USERS_0)
username: String @join__field(graph: CONNECTORS_QUERY_USER_0)
rest: JSON @join__field(graph: CONNECTORS_QUERY_USER_0)
d: String @join__field(graph: CONNECTORS_USER_D_1)
c: String @join__field(graph: CONNECTORS_USER_D_1) @join__field(graph: GRAPHQL)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type User {
id: ID!
name: String
username: String
rest: JSON
c: String
d: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ty
None,
),
],
star: None,
range: Some(
2..8,
),
Expand Down Expand Up @@ -119,23 +118,20 @@ input_file: apollo-federation/src/sources/connect/expand/tests/schemas/expand/ty
None,
),
],
star: None,
range: Some(
15..21,
),
},
),
),
],
star: None,
range: Some(
11..23,
),
},
),
),
],
star: None,
range: Some(
0..23,
),
Expand Down
Loading

0 comments on commit 82e262b

Please sign in to comment.