-
-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23e4e1e
commit 688156b
Showing
5 changed files
with
255 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
...andLine.Tests/__snapshots__/ComposeCommandTests.Compose_Fusion_Graph_Remove_Subgraph.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
Schema Document | ||
--------------- | ||
schema { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
type Query { | ||
userById(id: ID!): User | ||
users: [User!]! | ||
usersById(ids: [ID!]!): [User!]! | ||
viewer: Viewer! | ||
} | ||
|
||
type Mutation { | ||
addUser(input: AddUserInput!): AddUserPayload! | ||
} | ||
|
||
type AddUserPayload { | ||
user: User | ||
} | ||
|
||
type SomeData { | ||
accountValue: String! | ||
} | ||
|
||
type User implements Node { | ||
birthdate: Date! | ||
id: ID! | ||
name: String! | ||
username: String! | ||
} | ||
|
||
type Viewer { | ||
data: SomeData! | ||
user: User | ||
} | ||
|
||
"The node interface is implemented by entities that have a global unique identifier." | ||
interface Node { | ||
id: ID! | ||
} | ||
|
||
input AddUserInput { | ||
birthdate: Date! | ||
name: String! | ||
username: String! | ||
} | ||
|
||
"The `Date` scalar represents an ISO-8601 compliant date type." | ||
scalar Date | ||
--------------- | ||
|
||
Fusion Graph Document | ||
--------------- | ||
schema @fusion(version: 1) @transport(subgraph: "Accounts", group: "Fusion", location: "http:\/\/localhost:5000\/graphql", kind: "HTTP") @transport(subgraph: "Accounts", group: "Fusion", location: "ws:\/\/localhost:5000\/graphql", kind: "WebSocket") { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
type Query { | ||
userById(id: ID!): User @variable(subgraph: "Accounts", name: "id", argument: "id") @resolver(subgraph: "Accounts", select: "{ userById(id: $id) }", arguments: [ { name: "id", type: "ID!" } ]) | ||
users: [User!]! @resolver(subgraph: "Accounts", select: "{ users }") | ||
usersById(ids: [ID!]!): [User!]! @variable(subgraph: "Accounts", name: "ids", argument: "ids") @resolver(subgraph: "Accounts", select: "{ usersById(ids: $ids) }", arguments: [ { name: "ids", type: "[ID!]!" } ]) | ||
viewer: Viewer! @resolver(subgraph: "Accounts", select: "{ viewer }") | ||
} | ||
|
||
type Mutation { | ||
addUser(input: AddUserInput!): AddUserPayload! @variable(subgraph: "Accounts", name: "input", argument: "input") @resolver(subgraph: "Accounts", select: "{ addUser(input: $input) }", arguments: [ { name: "input", type: "AddUserInput!" } ]) | ||
} | ||
|
||
type AddUserPayload { | ||
user: User @source(subgraph: "Accounts") | ||
} | ||
|
||
type SomeData { | ||
accountValue: String! @source(subgraph: "Accounts") | ||
} | ||
|
||
type User implements Node @variable(subgraph: "Accounts", name: "User_id", select: "id") @resolver(subgraph: "Accounts", select: "{ userById(id: $User_id) }", arguments: [ { name: "User_id", type: "ID!" } ]) @resolver(subgraph: "Accounts", select: "{ usersById(ids: $User_id) }", arguments: [ { name: "User_id", type: "[ID!]!" } ], kind: "BATCH") { | ||
birthdate: Date! @source(subgraph: "Accounts") | ||
id: ID! @source(subgraph: "Accounts") | ||
name: String! @source(subgraph: "Accounts") | ||
username: String! @source(subgraph: "Accounts") | ||
} | ||
|
||
type Viewer { | ||
data: SomeData! @source(subgraph: "Accounts") | ||
user: User @source(subgraph: "Accounts") | ||
} | ||
|
||
"The node interface is implemented by entities that have a global unique identifier." | ||
interface Node { | ||
id: ID! | ||
} | ||
|
||
input AddUserInput { | ||
birthdate: Date! | ||
name: String! | ||
username: String! | ||
} | ||
|
||
"The `Date` scalar represents an ISO-8601 compliant date type." | ||
scalar Date | ||
--------------- | ||
|
||
Accounts Subgraph Configuration | ||
--------------- | ||
{ | ||
"Name": "Accounts", | ||
"Schema": "schema {\n query: Query\n mutation: Mutation\n}\n\n\"The node interface is implemented by entities that have a global unique identifier.\"\ninterface Node {\n id: ID!\n}\n\ntype Query {\n \"Fetches an object given its ID.\"\n node(\"ID of the object.\" id: ID!): Node\n \"Lookup nodes by a list of IDs.\"\n nodes(\"The list of node IDs.\" ids: [ID!]!): [Node]!\n users: [User!]!\n userById(id: ID!): User\n usersById(ids: [ID!]!): [User!]!\n viewer: Viewer!\n}\n\ntype Mutation {\n addUser(input: AddUserInput!): AddUserPayload!\n}\n\n\"The `Date` scalar represents an ISO-8601 compliant date type.\"\nscalar Date\n\ntype User implements Node {\n id: ID!\n name: String!\n birthdate: Date!\n username: String!\n}\n\ntype Viewer {\n user: User\n data: SomeData!\n}\n\ntype SomeData {\n accountValue: String!\n}\n\ninput AddUserInput {\n name: String!\n username: String!\n birthdate: Date!\n}\n\ntype AddUserPayload {\n user: User\n}", | ||
"Extensions": [ | ||
"extend type Query {\n userById(id: ID!\n @is(field: \"id\")): User!\n usersById(ids: [ID!]!\n @is(field: \"id\")): [User!]!\n}" | ||
], | ||
"Clients": [ | ||
{ | ||
"ClientName": null, | ||
"BaseAddress": "http://localhost:5000/graphql" | ||
}, | ||
{ | ||
"ClientName": null, | ||
"BaseAddress": "ws://localhost:5000/graphql" | ||
} | ||
], | ||
"ConfigurationExtensions": null | ||
} | ||
--------------- |