diff --git a/.changeset/tidy-masks-suffer.md b/.changeset/tidy-masks-suffer.md new file mode 100644 index 0000000000000..17f1bb0ade1f4 --- /dev/null +++ b/.changeset/tidy-masks-suffer.md @@ -0,0 +1,6 @@ +--- +'@graphql-mesh/transport-grpc': patch +'@graphql-mesh/utils': patch +--- + +Handle transformed gRPC sources correctly diff --git a/e2e/grpc-multiple/__snapshots__/grpc-multiple.test.ts.snap b/e2e/grpc-multiple/__snapshots__/grpc-multiple.test.ts.snap index 1938244a69c52..eedf1fd83581f 100644 --- a/e2e/grpc-multiple/__snapshots__/grpc-multiple.test.ts.snap +++ b/e2e/grpc-multiple/__snapshots__/grpc-multiple.test.ts.snap @@ -12,7 +12,7 @@ schema @link( url: "https://the-guild.dev/graphql/mesh/spec/v1.0" - import: ["@grpcMethod", "@grpcConnectivityState", "@transport", "@extraSchemaDefinitionDirective"] + import: ["@grpcMethod", "@grpcConnectivityState", "@transport", "@source", "@extraSchemaDefinitionDirective"] ) { query: Query @@ -97,6 +97,8 @@ directive @grpcConnectivityState(subgraph: String, rootJsonName: String, objPath directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA +directive @source(name: String!, type: String, subgraph: String!) repeatable on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + directive @extraSchemaDefinitionDirective(directives: _DirectiveExtensions) repeatable on OBJECT """ @@ -122,32 +124,47 @@ type Query @extraSchemaDefinitionDirective( ) @extraSchemaDefinitionDirective( directives: {transport: [{subgraph: "Stores", kind: "grpc", location: "localhost:", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"petstore\\":{\\"nested\\":{\\"PetStore\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int32\\",\\"id\\":1,\\"comment\\":null},\\"name\\":{\\"type\\":\\"string\\",\\"id\\":2,\\"comment\\":null},\\"location\\":{\\"type\\":\\"int32\\",\\"id\\":3,\\"comment\\":null},\\"petsForSale\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"int32\\",\\"id\\":4,\\"comment\\":null}},\\"comment\\":\\"Message for pet store information\\"},\\"Empty\\":{\\"fields\\":{},\\"comment\\":\\"Request to get all pet stores\\"},\\"PetStoreList\\":{\\"fields\\":{\\"petStores\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"PetStore\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":\\"Response with a list of pet stores\\"},\\"PetStoreService\\":{\\"methods\\":{\\"GetAllPetStores\\":{\\"requestType\\":\\"Empty\\",\\"responseType\\":\\"PetStoreList\\",\\"comment\\":null},\\"GetPetStorePets\\":{\\"requestType\\":\\"PetStore\\",\\"responseType\\":\\"PetStore\\",\\"comment\\":null}},\\"comment\\":\\"Service definition for pet store\\"}}}}}"}]}}]} ) @join__type(graph: PETS) @join__type(graph: STORES) { - pets_PetService_GetAllPets(input: pets__Empty_Input) : pets__Pets @grpcMethod( + GetAllPets(input: pets__Empty_Input) : pets__Pets @grpcMethod( subgraph: "Pets" rootJsonName: "Root0" objPath: "pets.PetService" methodName: "GetAllPets" responseStream: false - ) @join__field(graph: PETS) - pets_PetService_connectivityState(tryToConnect: Boolean) : ConnectivityState @grpcConnectivityState(subgraph: "Pets", rootJsonName: "Root0", objPath: "pets.PetService") @join__field(graph: PETS) - petstore_PetStoreService_GetAllPetStores(input: petstore__Empty_Input) : petstore__PetStoreList @grpcMethod( + ) @source(name: "pets_PetService_GetAllPets", type: "pets__Pets", subgraph: "Pets") @join__field(graph: PETS) + connectivityState(tryToConnect: Boolean) : ConnectivityState @grpcConnectivityState(subgraph: "Pets", rootJsonName: "Root0", objPath: "pets.PetService") @source( + name: "pets_PetService_connectivityState" + type: "ConnectivityState" + subgraph: "Pets" + ) @grpcConnectivityState( + subgraph: "Stores" + rootJsonName: "Root0" + objPath: "petstore.PetStoreService" + ) @source( + name: "petstore_PetStoreService_connectivityState" + type: "ConnectivityState" + subgraph: "Stores" + ) + GetAllPetStores(input: petstore__Empty_Input) : petstore__PetStoreList @grpcMethod( subgraph: "Stores" rootJsonName: "Root0" objPath: "petstore.PetStoreService" methodName: "GetAllPetStores" responseStream: false + ) @source( + name: "petstore_PetStoreService_GetAllPetStores" + type: "petstore__PetStoreList" + subgraph: "Stores" ) @join__field(graph: STORES) - petstore_PetStoreService_GetPetStorePets(input: petstore__PetStore_Input) : petstore__PetStore @grpcMethod( + GetPetStorePets(input: petstore__PetStore_Input) : petstore__PetStore @grpcMethod( subgraph: "Stores" rootJsonName: "Root0" objPath: "petstore.PetStoreService" methodName: "GetPetStorePets" responseStream: false - ) @join__field(graph: STORES) - petstore_PetStoreService_connectivityState(tryToConnect: Boolean) : ConnectivityState @grpcConnectivityState( + ) @source( + name: "petstore_PetStoreService_GetPetStorePets" + type: "petstore__PetStore" subgraph: "Stores" - rootJsonName: "Root0" - objPath: "petstore.PetStoreService" ) @join__field(graph: STORES) } @@ -207,7 +224,7 @@ input petstore__PetStore_Input @join__type(graph: STORES) { exports[`gRPC Multiple works: GetAllPetStores 1`] = ` { "data": { - "petstore_PetStoreService_GetAllPetStores": { + "GetAllPetStores": { "petStores": [ { "id": 1, @@ -238,7 +255,7 @@ exports[`gRPC Multiple works: GetAllPetStores 1`] = ` exports[`gRPC Multiple works: GetAllPets 1`] = ` { "data": { - "pets_PetService_GetAllPets": { + "GetAllPets": { "pets": [ { "id": 1, diff --git a/e2e/grpc-multiple/grpc-multiple.test.ts b/e2e/grpc-multiple/grpc-multiple.test.ts index 5a7fec191ee7d..10be344d4e550 100644 --- a/e2e/grpc-multiple/grpc-multiple.test.ts +++ b/e2e/grpc-multiple/grpc-multiple.test.ts @@ -5,7 +5,7 @@ describe('gRPC Multiple', () => { const queries = { GetAllPets: /* GraphQL */ ` query GetAllPets { - pets_PetService_GetAllPets { + GetAllPets { pets { id name @@ -15,7 +15,7 @@ describe('gRPC Multiple', () => { `, GetAllPetStores: /* GraphQL */ ` query GetAllPetStores { - petstore_PetStoreService_GetAllPetStores { + GetAllPetStores { petStores { id name diff --git a/e2e/grpc-multiple/mesh.config.ts b/e2e/grpc-multiple/mesh.config.ts index 6b4568dc41b61..b5a949b0efab3 100644 --- a/e2e/grpc-multiple/mesh.config.ts +++ b/e2e/grpc-multiple/mesh.config.ts @@ -1,5 +1,5 @@ import { Opts } from '@e2e/opts'; -import { defineConfig } from '@graphql-mesh/compose-cli'; +import { createRenameFieldTransform, defineConfig } from '@graphql-mesh/compose-cli'; import { loadGrpcSubgraph } from '@omnigraph/grpc'; const opts = Opts(process.argv); @@ -11,12 +11,20 @@ export const composeConfig = defineConfig({ endpoint: 'localhost:' + opts.getServicePort('Pets'), source: './services/Pets/pets.proto', // only needed when not running reflection }), + transforms: [ + createRenameFieldTransform(({ fieldName }) => fieldName.replace('pets_PetService_', '')), + ], }, { sourceHandler: loadGrpcSubgraph('Stores', { endpoint: 'localhost:' + opts.getServicePort('Stores'), source: './services/Stores/pet-store.proto', // only needed when not running reflection }), + transforms: [ + createRenameFieldTransform(({ fieldName }) => + fieldName.replace('petstore_PetStoreService_', ''), + ), + ], }, ], }); diff --git a/examples/grpc-example/tests/__snapshots__/grpc.test.ts.snap b/examples/grpc-example/tests/__snapshots__/grpc.test.ts.snap index b4fd09eec275f..f4b37854406fa 100644 --- a/examples/grpc-example/tests/__snapshots__/grpc.test.ts.snap +++ b/examples/grpc-example/tests/__snapshots__/grpc.test.ts.snap @@ -119,7 +119,7 @@ exports[`gRPC Example should fetch movies by cast as a subscription correctly: m `; exports[`gRPC Example should generate correct schema: grpc-schema 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost:50051", options: {requestTimeout: 200000, metaData: {someKey: "someValue", connection_type: "{context.headers.connection}"}, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int64\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Example", kind: "grpc", location: "localhost:50051", options: {requestTimeout: 200000, metaData: {someKey: "someValue", connection_type: "{context.headers.connection}"}, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int64\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query subscription: Subscription } @@ -146,15 +146,15 @@ directive @transport(subgraph: String, kind: String, location: String, options: type Query { """get all movies""" - exampleGetMovies(input: MovieRequest_Input): MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example", methodName: "GetMovies", responseStream: false) + exampleGetMovies(input: MovieRequest_Input): MoviesResult @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "Example", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - exampleSearchMoviesByCast(input: SearchByCastRequest_Input): [Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example", methodName: "SearchMoviesByCast", responseStream: true) - exampleConnectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example") + exampleSearchMoviesByCast(input: SearchByCastRequest_Input): [Movie] @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "Example", methodName: "SearchMoviesByCast", responseStream: true) + exampleConnectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Example", rootJsonName: "Root0", objPath: "Example") """get all movies""" - anotherExampleGetMovies(input: MovieRequest_Input): MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "GetMovies", responseStream: false) + anotherExampleGetMovies(input: MovieRequest_Input): MoviesResult @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - anotherExampleSearchMoviesByCast(input: SearchByCastRequest_Input): [Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) - anotherExampleConnectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "AnotherExample") + anotherExampleSearchMoviesByCast(input: SearchByCastRequest_Input): [Movie] @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + anotherExampleConnectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Example", rootJsonName: "Root0", objPath: "AnotherExample") } """movie result message, contains list of movies""" @@ -185,9 +185,9 @@ type google__protobuf__Timestamp { } enum Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "Example", value: "0") + ACTION @enum(subgraph: "Example", value: "1") + DRAMA @enum(subgraph: "Example", value: "2") } input MovieRequest_Input { @@ -224,9 +224,9 @@ enum ConnectivityState { type Subscription { """search movies by the name of the cast""" - exampleSearchMoviesByCast(input: SearchByCastRequest_Input): Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example", methodName: "SearchMoviesByCast", responseStream: true) + exampleSearchMoviesByCast(input: SearchByCastRequest_Input): Movie @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - anotherExampleSearchMoviesByCast(input: SearchByCastRequest_Input): Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + anotherExampleSearchMoviesByCast(input: SearchByCastRequest_Input): Movie @grpcMethod(subgraph: "Example", rootJsonName: "Root0", objPath: "AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" diff --git a/examples/grpc-reflection-example/tests/__snapshots__/grpc-reflection.test.ts.snap b/examples/grpc-reflection-example/tests/__snapshots__/grpc-reflection.test.ts.snap index 93f7fcdc44eb9..7c53ee3a65eb6 100644 --- a/examples/grpc-reflection-example/tests/__snapshots__/grpc-reflection.test.ts.snap +++ b/examples/grpc-reflection-example/tests/__snapshots__/grpc-reflection.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`gRPC Reflection Example should generate correct schema: grpc-schema 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost:50052", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"nested\\":{\\"helloworld\\":{\\"nested\\":{\\"GreetingRequest\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"GreetingResult\\":{\\"fields\\":{\\"greeting\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"GreetingService\\":{\\"methods\\":{\\"GetGreeting\\":{\\"requestType\\":\\".helloworld.GreetingRequest\\",\\"responseType\\":\\".helloworld.GreetingResult\\"}},\\"comment\\":null}}}}}"}, {name: "Root1", rootJson: "{\\"nested\\":{\\"artnet\\":{\\"nested\\":{\\"coredata\\":{\\"nested\\":{\\"playground\\":{\\"nested\\":{\\"EchoInputRequest\\":{\\"fields\\":{\\"price\\":{\\"type\\":\\"PlayGroundPriceFilter\\",\\"id\\":3}},\\"comment\\":null},\\"EchoUserInfoRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"EchoUserInfoResponse\\":{\\"fields\\":{\\"userInfo\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"PlayGroundPriceFilter\\":{\\"fields\\":{\\"range\\":{\\"type\\":\\"PlayGroundPriceRange\\",\\"id\\":1}},\\"comment\\":null},\\"PlayGroundPriceRange\\":{\\"fields\\":{\\"valueDouble\\":{\\"type\\":\\"google.protobuf.DoubleValue\\",\\"id\\":1},\\"valueFloat\\":{\\"type\\":\\"google.protobuf.FloatValue\\",\\"id\\":2},\\"valueLong\\":{\\"type\\":\\"google.protobuf.Int64Value\\",\\"id\\":3},\\"valueInt\\":{\\"type\\":\\"google.protobuf.Int64Value\\",\\"id\\":4},\\"valueLongNotnull\\":{\\"type\\":\\"int64\\",\\"id\\":5}},\\"comment\\":null},\\"SnailMailRequest\\":{\\"fields\\":{\\"allowCancellation\\":{\\"type\\":\\"bool\\",\\"id\\":1},\\"fakeDataLength\\":{\\"type\\":\\"int32\\",\\"id\\":2},\\"waitSeconds\\":{\\"type\\":\\"int32\\",\\"id\\":3}},\\"comment\\":null},\\"SnailMailResponse\\":{\\"fields\\":{\\"fakeData\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"Playground\\":{\\"methods\\":{\\"GetInput\\":{\\"requestType\\":\\".artnet.coredata.playground.EchoInputRequest\\",\\"responseType\\":\\".artnet.coredata.playground.EchoInputRequest\\"},\\"GetSnailMail\\":{\\"requestType\\":\\".artnet.coredata.playground.SnailMailRequest\\",\\"responseType\\":\\".artnet.coredata.playground.SnailMailResponse\\"},\\"GetUserInfo\\":{\\"requestType\\":\\".artnet.coredata.playground.EchoUserInfoRequest\\",\\"responseType\\":\\".artnet.coredata.playground.EchoUserInfoResponse\\"}},\\"comment\\":null}}}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"DoubleValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"double\\",\\"id\\":1}},\\"comment\\":null},\\"FloatValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"float\\",\\"id\\":1}},\\"comment\\":null},\\"Int64Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"int64\\",\\"id\\":1}},\\"comment\\":null},\\"UInt64Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"uint64\\",\\"id\\":1}},\\"comment\\":null},\\"Int32Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"int32\\",\\"id\\":1}},\\"comment\\":null},\\"UInt32Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"uint32\\",\\"id\\":1}},\\"comment\\":null},\\"BoolValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"bool\\",\\"id\\":1}},\\"comment\\":null},\\"StringValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"BytesValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"bytes\\",\\"id\\":1}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "gRPC Example", kind: "grpc", location: "localhost:50052", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"nested\\":{\\"helloworld\\":{\\"nested\\":{\\"GreetingRequest\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"GreetingResult\\":{\\"fields\\":{\\"greeting\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"GreetingService\\":{\\"methods\\":{\\"GetGreeting\\":{\\"requestType\\":\\".helloworld.GreetingRequest\\",\\"responseType\\":\\".helloworld.GreetingResult\\"}},\\"comment\\":null}}}}}"}, {name: "Root1", rootJson: "{\\"nested\\":{\\"artnet\\":{\\"nested\\":{\\"coredata\\":{\\"nested\\":{\\"playground\\":{\\"nested\\":{\\"EchoInputRequest\\":{\\"fields\\":{\\"price\\":{\\"type\\":\\"PlayGroundPriceFilter\\",\\"id\\":3}},\\"comment\\":null},\\"EchoUserInfoRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"EchoUserInfoResponse\\":{\\"fields\\":{\\"userInfo\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"PlayGroundPriceFilter\\":{\\"fields\\":{\\"range\\":{\\"type\\":\\"PlayGroundPriceRange\\",\\"id\\":1}},\\"comment\\":null},\\"PlayGroundPriceRange\\":{\\"fields\\":{\\"valueDouble\\":{\\"type\\":\\"google.protobuf.DoubleValue\\",\\"id\\":1},\\"valueFloat\\":{\\"type\\":\\"google.protobuf.FloatValue\\",\\"id\\":2},\\"valueLong\\":{\\"type\\":\\"google.protobuf.Int64Value\\",\\"id\\":3},\\"valueInt\\":{\\"type\\":\\"google.protobuf.Int64Value\\",\\"id\\":4},\\"valueLongNotnull\\":{\\"type\\":\\"int64\\",\\"id\\":5}},\\"comment\\":null},\\"SnailMailRequest\\":{\\"fields\\":{\\"allowCancellation\\":{\\"type\\":\\"bool\\",\\"id\\":1},\\"fakeDataLength\\":{\\"type\\":\\"int32\\",\\"id\\":2},\\"waitSeconds\\":{\\"type\\":\\"int32\\",\\"id\\":3}},\\"comment\\":null},\\"SnailMailResponse\\":{\\"fields\\":{\\"fakeData\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"Playground\\":{\\"methods\\":{\\"GetInput\\":{\\"requestType\\":\\".artnet.coredata.playground.EchoInputRequest\\",\\"responseType\\":\\".artnet.coredata.playground.EchoInputRequest\\"},\\"GetSnailMail\\":{\\"requestType\\":\\".artnet.coredata.playground.SnailMailRequest\\",\\"responseType\\":\\".artnet.coredata.playground.SnailMailResponse\\"},\\"GetUserInfo\\":{\\"requestType\\":\\".artnet.coredata.playground.EchoUserInfoRequest\\",\\"responseType\\":\\".artnet.coredata.playground.EchoUserInfoResponse\\"}},\\"comment\\":null}}}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"DoubleValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"double\\",\\"id\\":1}},\\"comment\\":null},\\"FloatValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"float\\",\\"id\\":1}},\\"comment\\":null},\\"Int64Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"int64\\",\\"id\\":1}},\\"comment\\":null},\\"UInt64Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"uint64\\",\\"id\\":1}},\\"comment\\":null},\\"Int32Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"int32\\",\\"id\\":1}},\\"comment\\":null},\\"UInt32Value\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"uint32\\",\\"id\\":1}},\\"comment\\":null},\\"BoolValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"bool\\",\\"id\\":1}},\\"comment\\":null},\\"StringValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1}},\\"comment\\":null},\\"BytesValue\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"bytes\\",\\"id\\":1}},\\"comment\\":null}}}}}}}"}]}) { query: Query } @@ -24,12 +24,12 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - helloworld_GreetingService_GetGreeting(input: helloworld__GreetingRequest_Input): helloworld__GreetingResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "helloworld.GreetingService", methodName: "GetGreeting", responseStream: false) - helloworld_GreetingService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "helloworld.GreetingService") - artnet_coredata_playground_Playground_GetInput(input: artnet__coredata__playground__EchoInputRequest_Input): artnet__coredata__playground__EchoInputRequest @grpcMethod(subgraph: "grpc", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetInput", responseStream: false) - artnet_coredata_playground_Playground_GetSnailMail(input: artnet__coredata__playground__SnailMailRequest_Input): artnet__coredata__playground__SnailMailResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetSnailMail", responseStream: false) - artnet_coredata_playground_Playground_GetUserInfo(input: artnet__coredata__playground__EchoUserInfoRequest_Input): artnet__coredata__playground__EchoUserInfoResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetUserInfo", responseStream: false) - artnet_coredata_playground_Playground_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground") + helloworld_GreetingService_GetGreeting(input: helloworld__GreetingRequest_Input): helloworld__GreetingResult @grpcMethod(subgraph: "gRPC Example", rootJsonName: "Root0", objPath: "helloworld.GreetingService", methodName: "GetGreeting", responseStream: false) + helloworld_GreetingService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "gRPC Example", rootJsonName: "Root0", objPath: "helloworld.GreetingService") + artnet_coredata_playground_Playground_GetInput(input: artnet__coredata__playground__EchoInputRequest_Input): artnet__coredata__playground__EchoInputRequest @grpcMethod(subgraph: "gRPC Example", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetInput", responseStream: false) + artnet_coredata_playground_Playground_GetSnailMail(input: artnet__coredata__playground__SnailMailRequest_Input): artnet__coredata__playground__SnailMailResponse @grpcMethod(subgraph: "gRPC Example", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetSnailMail", responseStream: false) + artnet_coredata_playground_Playground_GetUserInfo(input: artnet__coredata__playground__EchoUserInfoRequest_Input): artnet__coredata__playground__EchoUserInfoResponse @grpcMethod(subgraph: "gRPC Example", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground", methodName: "GetUserInfo", responseStream: false) + artnet_coredata_playground_Playground_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "gRPC Example", rootJsonName: "Root1", objPath: "artnet.coredata.playground.Playground") } type helloworld__GreetingResult { diff --git a/jest.config.js b/jest.config.js index 47347cf266df1..31f1ae27bc3ed 100644 --- a/jest.config.js +++ b/jest.config.js @@ -27,7 +27,7 @@ if (process.env.LEAK_TEST) { let testMatch = ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)']; if (process.env.LEAK_TEST) { - testMatch.push('!**/examples/grpc-*/**'); + testMatch.push('!**/examples/grpc-reflection-example/**'); testMatch.push('!**/examples/sqlite-*/**'); testMatch.push('!**/examples/mysql-*/**'); testMatch.push('!**/examples/v1-next/mysql-*/**'); diff --git a/packages/legacy/handlers/grpc/src/index.ts b/packages/legacy/handlers/grpc/src/index.ts index 17528a92b3799..ff6e853627f3b 100644 --- a/packages/legacy/handlers/grpc/src/index.ts +++ b/packages/legacy/handlers/grpc/src/index.ts @@ -62,7 +62,8 @@ export default class GrpcHandler implements MeshHandler { } return this.schemaWithAnnotationsProxy.getWithSet( () => - loadGrpcSubgraph('grpc', this.config)({ cwd: this.baseDir, logger: this.logger }).schema$, + loadGrpcSubgraph(this.sourceName, this.config)({ cwd: this.baseDir, logger: this.logger }) + .schema$, ); } diff --git a/packages/legacy/handlers/grpc/test/__snapshots__/handler.spec.ts.snap b/packages/legacy/handlers/grpc/test/__snapshots__/handler.spec.ts.snap index 58178a051f6de..04e3aa13e73f5 100644 --- a/packages/legacy/handlers/grpc/test/__snapshots__/handler.spec.ts.snap +++ b/packages/legacy/handlers/grpc/test/__snapshots__/handler.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`gRPC Handler Interpreting Protos should load the Comments proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foo\\":{\\"nested\\":{\\"SampleService\\":{\\"methods\\":{\\"CreateSample\\":{\\"requestType\\":\\"CreateSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 1: This is a comment with two slashes\\"},\\"GetSample\\":{\\"requestType\\":\\"GetSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 2: This is a comment with initial slash star and final star slash (all on one line)\\"},\\"UpdateSample\\":{\\"requestType\\":\\"UpdateSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 3: This is a comment with initial slash star star and final star slash (all on one line\\"},\\"DeleteSample\\":{\\"requestType\\":\\"DeleteSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 4: This is a comment on multiple lines, initial slash star star\\\\nat beginning of the line.\\"}},\\"comment\\":null},\\"SampleResponse\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":\\"Comment 5: This is a comment on one line, delimiters slash star star at beginning of the line. Trailing comment delimiter at beginning of next line after comment.\\"},\\"CreateSampleRequest\\":{\\"fields\\":{\\"description\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 6: This is a comment with slash followed by two stars at the beginning. The first comment delimiter is at the beginning of the line. Trailing comment delimiter on same line as text.\\"},\\"type\\":{\\"type\\":\\"string\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null},\\"GetSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 8: This is a comment with slash star delimiter on the same line as a field definition.\\"}},\\"comment\\":\\"Comment 7: This is a comment with slash followed by two stars at the beginning. The first comment delimiter is not at the beginning of the line.\\"},\\"UpdateSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 10: This is a comment with slash star star delimiter on the same line as a field definition.\\"}},\\"comment\\":null},\\"DeleteSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 12: This is a two-slash comment on the same line as a field definition.\\"}},\\"comment\\":null}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Comments", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foo\\":{\\"nested\\":{\\"SampleService\\":{\\"methods\\":{\\"CreateSample\\":{\\"requestType\\":\\"CreateSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 1: This is a comment with two slashes\\"},\\"GetSample\\":{\\"requestType\\":\\"GetSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 2: This is a comment with initial slash star and final star slash (all on one line)\\"},\\"UpdateSample\\":{\\"requestType\\":\\"UpdateSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 3: This is a comment with initial slash star star and final star slash (all on one line\\"},\\"DeleteSample\\":{\\"requestType\\":\\"DeleteSampleRequest\\",\\"responseType\\":\\"SampleResponse\\",\\"comment\\":\\"Comment 4: This is a comment on multiple lines, initial slash star star\\\\nat beginning of the line.\\"}},\\"comment\\":null},\\"SampleResponse\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":\\"Comment 5: This is a comment on one line, delimiters slash star star at beginning of the line. Trailing comment delimiter at beginning of next line after comment.\\"},\\"CreateSampleRequest\\":{\\"fields\\":{\\"description\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 6: This is a comment with slash followed by two stars at the beginning. The first comment delimiter is at the beginning of the line. Trailing comment delimiter on same line as text.\\"},\\"type\\":{\\"type\\":\\"string\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null},\\"GetSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 8: This is a comment with slash star delimiter on the same line as a field definition.\\"}},\\"comment\\":\\"Comment 7: This is a comment with slash followed by two stars at the beginning. The first comment delimiter is not at the beginning of the line.\\"},\\"UpdateSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 10: This is a comment with slash star star delimiter on the same line as a field definition.\\"}},\\"comment\\":null},\\"DeleteSampleRequest\\":{\\"fields\\":{\\"sample_id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":\\"Comment 12: This is a two-slash comment on the same line as a field definition.\\"}},\\"comment\\":null}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query mutation: Mutation } @@ -28,8 +28,8 @@ type Query { """ Comment 2: This is a comment with initial slash star and final star slash (all on one line) """ - foo_SampleService_GetSample(input: foo__GetSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "GetSample", responseStream: false) - foo_SampleService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.SampleService") + foo_SampleService_GetSample(input: foo__GetSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "Comments", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "GetSample", responseStream: false) + foo_SampleService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Comments", rootJsonName: "Root0", objPath: "foo.SampleService") } """ @@ -59,16 +59,16 @@ enum ConnectivityState { type Mutation { """Comment 1: This is a comment with two slashes""" - foo_SampleService_CreateSample(input: foo__CreateSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "CreateSample", responseStream: false) + foo_SampleService_CreateSample(input: foo__CreateSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "Comments", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "CreateSample", responseStream: false) """ Comment 3: This is a comment with initial slash star star and final star slash (all on one line """ - foo_SampleService_UpdateSample(input: foo__UpdateSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "UpdateSample", responseStream: false) + foo_SampleService_UpdateSample(input: foo__UpdateSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "Comments", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "UpdateSample", responseStream: false) """ Comment 4: This is a comment on multiple lines, initial slash star star at beginning of the line. """ - foo_SampleService_DeleteSample(input: foo__DeleteSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "DeleteSample", responseStream: false) + foo_SampleService_DeleteSample(input: foo__DeleteSampleRequest_Input): foo__SampleResponse @grpcMethod(subgraph: "Comments", rootJsonName: "Root0", objPath: "foo.SampleService", methodName: "DeleteSample", responseStream: false) } input foo__CreateSampleRequest_Input { @@ -97,7 +97,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Custom Message proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foos\\":{\\"nested\\":{\\"BamService\\":{\\"methods\\":{\\"GetW\\":{\\"requestType\\":\\"GetBamRequest\\",\\"responseType\\":\\"GetFoosResponse\\",\\"comment\\":null}},\\"comment\\":null},\\"GetBamRequest\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int32\\",\\"id\\":1,\\"comment\\":null},\\"abcd\\":{\\"type\\":\\"Bam\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null},\\"Bam\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int64\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"GetFoosResponse\\":{\\"fields\\":{\\"abcd\\":{\\"type\\":\\"Bam\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null}}}}}"}]}) { +"schema @transport(subgraph: "Custom Message", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foos\\":{\\"nested\\":{\\"BamService\\":{\\"methods\\":{\\"GetW\\":{\\"requestType\\":\\"GetBamRequest\\",\\"responseType\\":\\"GetFoosResponse\\",\\"comment\\":null}},\\"comment\\":null},\\"GetBamRequest\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int32\\",\\"id\\":1,\\"comment\\":null},\\"abcd\\":{\\"type\\":\\"Bam\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null},\\"Bam\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int64\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"GetFoosResponse\\":{\\"fields\\":{\\"abcd\\":{\\"type\\":\\"Bam\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null}}}}}"}]}) { query: Query } @@ -120,8 +120,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - foos_BamService_GetW(input: foos__GetBamRequest_Input): foos__GetFoosResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foos.BamService", methodName: "GetW", responseStream: false) - foos_BamService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "foos.BamService") + foos_BamService_GetW(input: foos__GetBamRequest_Input): foos__GetFoosResponse @grpcMethod(subgraph: "Custom Message", rootJsonName: "Root0", objPath: "foos.BamService", methodName: "GetW", responseStream: false) + foos_BamService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Custom Message", rootJsonName: "Root0", objPath: "foos.BamService") } type foos__GetFoosResponse { @@ -158,7 +158,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Custom Message2 proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foo\\":{\\"nested\\":{\\"BamService\\":{\\"methods\\":{\\"GetFOOs\\":{\\"requestType\\":\\"GetFOOsRequest\\",\\"responseType\\":\\"GetFOOsResponse\\",\\"comment\\":null}},\\"comment\\":null},\\"GetFOOsRequest\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int32\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"FOO\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int64\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"GetFOOsResponse\\":{\\"fields\\":{\\"foos\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"FOO\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null}}}}}"}]}) { +"schema @transport(subgraph: "Custom Message2", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"foo\\":{\\"nested\\":{\\"BamService\\":{\\"methods\\":{\\"GetFOOs\\":{\\"requestType\\":\\"GetFOOsRequest\\",\\"responseType\\":\\"GetFOOsResponse\\",\\"comment\\":null}},\\"comment\\":null},\\"GetFOOsRequest\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int32\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"FOO\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"int64\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"GetFOOsResponse\\":{\\"fields\\":{\\"foos\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"FOO\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null}}}}}"}]}) { query: Query } @@ -181,8 +181,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - foo_BamService_GetFOOs(input: foo__GetFOOsRequest_Input): foo__GetFOOsResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.BamService", methodName: "GetFOOs", responseStream: false) - foo_BamService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "foo.BamService") + foo_BamService_GetFOOs(input: foo__GetFOOsRequest_Input): foo__GetFOOsResponse @grpcMethod(subgraph: "Custom Message2", rootJsonName: "Root0", objPath: "foo.BamService", methodName: "GetFOOs", responseStream: false) + foo_BamService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Custom Message2", rootJsonName: "Root0", objPath: "foo.BamService") } type foo__GetFOOsResponse { @@ -214,7 +214,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Empty proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"GetEmpty\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"EmptyRequest\\",\\"comment\\":null},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Empty", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"GetEmpty\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"EmptyRequest\\",\\"comment\\":null},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query subscription: Subscription } @@ -241,16 +241,16 @@ directive @transport(subgraph: String, kind: String, location: String, options: type Query { """get all movies""" - io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) - io_xtech_Example_GetEmpty(input: io__xtech__MovieRequest_Input): io__xtech__EmptyRequest @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetEmpty", responseStream: false) + io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) + io_xtech_Example_GetEmpty(input: io__xtech__MovieRequest_Input): io__xtech__EmptyRequest @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetEmpty", responseStream: false) """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.Example") """get all movies""" - io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) + io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") } """movie result message, contains list of movies""" @@ -281,9 +281,9 @@ The \`BigInt\` scalar type represents non-fractional signed whole numeric values scalar BigInt enum io__xtech__Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "Empty", value: "0") + ACTION @enum(subgraph: "Empty", value: "1") + DRAMA @enum(subgraph: "Empty", value: "2") } input io__xtech__MovieRequest_Input { @@ -322,16 +322,16 @@ enum ConnectivityState { type Subscription { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Empty", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Enums proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"OrganizationStateProto\\":{\\"values\\":{\\"UNKNOWN\\":0,\\"ACTIVE\\":1,\\"PENDING_PAYMENT\\":2,\\"SUSPENDED\\":3},\\"comment\\":null,\\"comments\\":{\\"UNKNOWN\\":null,\\"ACTIVE\\":null,\\"PENDING_PAYMENT\\":null,\\"SUSPENDED\\":null}},\\"OrganizationProto\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"owner\\":{\\"type\\":\\"string\\",\\"id\\":2,\\"comment\\":null},\\"name\\":{\\"type\\":\\"string\\",\\"id\\":3,\\"comment\\":null},\\"description\\":{\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":null},\\"image_url\\":{\\"type\\":\\"string\\",\\"id\\":5,\\"comment\\":null},\\"state\\":{\\"type\\":\\"OrganizationStateProto\\",\\"id\\":6,\\"comment\\":null},\\"default_org\\":{\\"type\\":\\"bool\\",\\"id\\":7,\\"comment\\":null}},\\"comment\\":null},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"OrganizationService\\":{\\"methods\\":{\\"GetOrganization\\":{\\"requestType\\":\\"EmptyRequest\\",\\"responseType\\":\\"OrganizationProto\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Enums", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"OrganizationStateProto\\":{\\"values\\":{\\"UNKNOWN\\":0,\\"ACTIVE\\":1,\\"PENDING_PAYMENT\\":2,\\"SUSPENDED\\":3},\\"comment\\":null,\\"comments\\":{\\"UNKNOWN\\":null,\\"ACTIVE\\":null,\\"PENDING_PAYMENT\\":null,\\"SUSPENDED\\":null}},\\"OrganizationProto\\":{\\"fields\\":{\\"id\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"owner\\":{\\"type\\":\\"string\\",\\"id\\":2,\\"comment\\":null},\\"name\\":{\\"type\\":\\"string\\",\\"id\\":3,\\"comment\\":null},\\"description\\":{\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":null},\\"image_url\\":{\\"type\\":\\"string\\",\\"id\\":5,\\"comment\\":null},\\"state\\":{\\"type\\":\\"OrganizationStateProto\\",\\"id\\":6,\\"comment\\":null},\\"default_org\\":{\\"type\\":\\"bool\\",\\"id\\":7,\\"comment\\":null}},\\"comment\\":null},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"OrganizationService\\":{\\"methods\\":{\\"GetOrganization\\":{\\"requestType\\":\\"EmptyRequest\\",\\"responseType\\":\\"OrganizationProto\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { query: Query } @@ -356,8 +356,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - io_xtech_OrganizationService_GetOrganization(input: io__xtech__EmptyRequest_Input): io__xtech__OrganizationProto @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.OrganizationService", methodName: "GetOrganization", responseStream: false) - io_xtech_OrganizationService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.OrganizationService") + io_xtech_OrganizationService_GetOrganization(input: io__xtech__EmptyRequest_Input): io__xtech__OrganizationProto @grpcMethod(subgraph: "Enums", rootJsonName: "Root0", objPath: "io.xtech.OrganizationService", methodName: "GetOrganization", responseStream: false) + io_xtech_OrganizationService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Enums", rootJsonName: "Root0", objPath: "io.xtech.OrganizationService") } type io__xtech__OrganizationProto { @@ -371,10 +371,10 @@ type io__xtech__OrganizationProto { } enum io__xtech__OrganizationStateProto { - UNKNOWN @enum(subgraph: "grpc", value: "0") - ACTIVE @enum(subgraph: "grpc", value: "1") - PENDING_PAYMENT @enum(subgraph: "grpc", value: "2") - SUSPENDED @enum(subgraph: "grpc", value: "3") + UNKNOWN @enum(subgraph: "Enums", value: "0") + ACTIVE @enum(subgraph: "Enums", value: "1") + PENDING_PAYMENT @enum(subgraph: "Enums", value: "2") + SUSPENDED @enum(subgraph: "Enums", value: "3") } scalar io__xtech__EmptyRequest_Input @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf") @@ -391,7 +391,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Import Nested proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"outer\\":{\\"nested\\":{\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"io.xtech.TopLevel.Nested\\",\\"responseType\\":\\"io.xtech.Result\\",\\"comment\\":null}},\\"comment\\":null}}},\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Import Nested", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"outer\\":{\\"nested\\":{\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"io.xtech.TopLevel.Nested\\",\\"responseType\\":\\"io.xtech.Result\\",\\"comment\\":null}},\\"comment\\":null}}},\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { query: Query } @@ -414,10 +414,10 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - io_xtech_outer_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.outer.Example", methodName: "Get", responseStream: false) - io_xtech_outer_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.outer.Example") - io_xtech_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "Get", responseStream: false) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_outer_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "Import Nested", rootJsonName: "Root0", objPath: "io.xtech.outer.Example", methodName: "Get", responseStream: false) + io_xtech_outer_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Import Nested", rootJsonName: "Root0", objPath: "io.xtech.outer.Example") + io_xtech_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "Import Nested", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "Get", responseStream: false) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Import Nested", rootJsonName: "Root0", objPath: "io.xtech.Example") } type io__xtech__Result { @@ -448,7 +448,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Input bug 5880 proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"TestMessage\\":{\\"fields\\":{\\"input\\":{\\"type\\":\\"Input\\",\\"id\\":1,\\"comment\\":null}},\\"nested\\":{\\"Input\\":{\\"fields\\":{},\\"comment\\":null}},\\"comment\\":null},\\"TestService\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TestMessage\\",\\"responseType\\":\\"TestMessage\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { +"schema @transport(subgraph: "Input bug 5880", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"TestMessage\\":{\\"fields\\":{\\"input\\":{\\"type\\":\\"Input\\",\\"id\\":1,\\"comment\\":null}},\\"nested\\":{\\"Input\\":{\\"fields\\":{},\\"comment\\":null}},\\"comment\\":null},\\"TestService\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TestMessage\\",\\"responseType\\":\\"TestMessage\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { query: Query } @@ -471,8 +471,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - TestService_Get(input: TestMessage_Input): TestMessage @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "TestService", methodName: "Get", responseStream: false) - TestService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "TestService") + TestService_Get(input: TestMessage_Input): TestMessage @grpcMethod(subgraph: "Input bug 5880", rootJsonName: "Root0", objPath: "TestService", methodName: "Get", responseStream: false) + TestService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Input bug 5880", rootJsonName: "Root0", objPath: "TestService") } type TestMessage { @@ -499,7 +499,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Map proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"MapRequest\\":{\\"fields\\":{\\"map\\":{\\"keyType\\":\\"string\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MapResponse\\":{\\"fields\\":{\\"map\\":{\\"keyType\\":\\"string\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MapService\\":{\\"methods\\":{\\"GetMap\\":{\\"requestType\\":\\"MapRequest\\",\\"responseType\\":\\"MapResponse\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Map", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"MapRequest\\":{\\"fields\\":{\\"map\\":{\\"keyType\\":\\"string\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MapResponse\\":{\\"fields\\":{\\"map\\":{\\"keyType\\":\\"string\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MapService\\":{\\"methods\\":{\\"GetMap\\":{\\"requestType\\":\\"MapRequest\\",\\"responseType\\":\\"MapResponse\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { query: Query } @@ -522,8 +522,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - io_xtech_MapService_GetMap(input: io__xtech__MapRequest_Input): io__xtech__MapResponse @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.MapService", methodName: "GetMap", responseStream: false) - io_xtech_MapService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.MapService") + io_xtech_MapService_GetMap(input: io__xtech__MapRequest_Input): io__xtech__MapResponse @grpcMethod(subgraph: "Map", rootJsonName: "Root0", objPath: "io.xtech.MapService", methodName: "GetMap", responseStream: false) + io_xtech_MapService_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Map", rootJsonName: "Root0", objPath: "io.xtech.MapService") } type io__xtech__MapResponse { @@ -551,7 +551,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Movie proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Movie", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query subscription: Subscription } @@ -578,15 +578,15 @@ directive @transport(subgraph: String, kind: String, location: String, options: type Query { """get all movies""" - io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) + io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.Example") """get all movies""" - io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) + io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") } """movie result message, contains list of movies""" @@ -617,9 +617,9 @@ The \`BigInt\` scalar type represents non-fractional signed whole numeric values scalar BigInt enum io__xtech__Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "Movie", value: "0") + ACTION @enum(subgraph: "Movie", value: "1") + DRAMA @enum(subgraph: "Movie", value: "2") } input io__xtech__MovieRequest_Input { @@ -656,16 +656,16 @@ enum ConnectivityState { type Subscription { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Movie", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Nested proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Nested", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}}}}}"}]}) { query: Query } @@ -688,8 +688,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - io_xtech_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "Get", responseStream: false) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_Get(input: io__xtech__TopLevel__Nested_Input): io__xtech__Result @grpcMethod(subgraph: "Nested", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "Get", responseStream: false) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Nested", rootJsonName: "Root0", objPath: "io.xtech.Example") } type io__xtech__Result { @@ -720,7 +720,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the No Package Nested proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { +"schema @transport(subgraph: "No Package Nested", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"TopLevel\\":{\\"fields\\":{\\"value\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"nested_usage\\":{\\"type\\":\\"Nested\\",\\"id\\":3,\\"comment\\":null}},\\"nested\\":{\\"Nested\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Item\\",\\"id\\":2,\\"comment\\":null}},\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"TopLevel.Nested\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { query: Query } @@ -743,8 +743,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - Example_Get(input: TopLevel__Nested_Input): Result @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example", methodName: "Get", responseStream: false) - Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example") + Example_Get(input: TopLevel__Nested_Input): Result @grpcMethod(subgraph: "No Package Nested", rootJsonName: "Root0", objPath: "Example", methodName: "Get", responseStream: false) + Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "No Package Nested", rootJsonName: "Root0", objPath: "Example") } type Result { @@ -775,7 +775,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the Outside proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"outside\\":{\\"nested\\":{\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"io.xtech.Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"io.xtech.Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":null}},\\"comment\\":null}}},\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "Outside", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"outside\\":{\\"nested\\":{\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"io.xtech.Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"io.xtech.Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":null}},\\"comment\\":null}}},\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"MovieRequest\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"MovieRequest\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query subscription: Subscription } @@ -801,18 +801,18 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - io_outside_Example_GetMovies(input: io__outside__MovieRequest_Input): io__outside__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.outside.Example", methodName: "GetMovies", responseStream: false) - io_outside_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.outside.Example") + io_outside_Example_GetMovies(input: io__outside__MovieRequest_Input): io__outside__MoviesResult @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.outside.Example", methodName: "GetMovies", responseStream: false) + io_outside_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.outside.Example") """get all movies""" - io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) + io_xtech_Example_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.Example") """get all movies""" - io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) + io_xtech_AnotherExample_GetMovies(input: io__xtech__MovieRequest_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") } type io__outside__MoviesResult { @@ -841,9 +841,9 @@ The \`BigInt\` scalar type represents non-fractional signed whole numeric values scalar BigInt enum io__xtech__Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "Outside", value: "0") + ACTION @enum(subgraph: "Outside", value: "1") + DRAMA @enum(subgraph: "Outside", value: "2") } input io__outside__MovieRequest_Input { @@ -890,16 +890,16 @@ input io__xtech__SearchByCastRequest_Input { type Subscription { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "Outside", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the With All Values proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"boolean\\":{\\"type\\":\\"bool\\",\\"id\\":1,\\"comment\\":null},\\"bytesType\\":{\\"type\\":\\"bytes\\",\\"id\\":2,\\"comment\\":null},\\"doubleNum\\":{\\"type\\":\\"double\\",\\"id\\":3,\\"comment\\":null},\\"fixedint32\\":{\\"type\\":\\"fixed32\\",\\"id\\":4,\\"comment\\":null},\\"fixedint64\\":{\\"type\\":\\"fixed64\\",\\"id\\":5,\\"comment\\":null},\\"floatNum\\":{\\"type\\":\\"float\\",\\"id\\":6,\\"comment\\":null},\\"integer32\\":{\\"type\\":\\"int32\\",\\"id\\":7,\\"comment\\":null},\\"integer64\\":{\\"type\\":\\"int64\\",\\"id\\":8,\\"comment\\":null},\\"sfixedint32\\":{\\"type\\":\\"sfixed32\\",\\"id\\":9,\\"comment\\":null},\\"sfixedint64\\":{\\"type\\":\\"sfixed64\\",\\"id\\":10,\\"comment\\":null},\\"sinteger32\\":{\\"type\\":\\"sint32\\",\\"id\\":11,\\"comment\\":null},\\"sinteger64\\":{\\"type\\":\\"sint64\\",\\"id\\":12,\\"comment\\":null},\\"str\\":{\\"type\\":\\"string\\",\\"id\\":13,\\"comment\\":null},\\"uinteger32\\":{\\"type\\":\\"uint32\\",\\"id\\":14,\\"comment\\":null},\\"uinteger64\\":{\\"type\\":\\"uint64\\",\\"id\\":15,\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"Item\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { +"schema @transport(subgraph: "With All Values", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"Item\\":{\\"fields\\":{\\"boolean\\":{\\"type\\":\\"bool\\",\\"id\\":1,\\"comment\\":null},\\"bytesType\\":{\\"type\\":\\"bytes\\",\\"id\\":2,\\"comment\\":null},\\"doubleNum\\":{\\"type\\":\\"double\\",\\"id\\":3,\\"comment\\":null},\\"fixedint32\\":{\\"type\\":\\"fixed32\\",\\"id\\":4,\\"comment\\":null},\\"fixedint64\\":{\\"type\\":\\"fixed64\\",\\"id\\":5,\\"comment\\":null},\\"floatNum\\":{\\"type\\":\\"float\\",\\"id\\":6,\\"comment\\":null},\\"integer32\\":{\\"type\\":\\"int32\\",\\"id\\":7,\\"comment\\":null},\\"integer64\\":{\\"type\\":\\"int64\\",\\"id\\":8,\\"comment\\":null},\\"sfixedint32\\":{\\"type\\":\\"sfixed32\\",\\"id\\":9,\\"comment\\":null},\\"sfixedint64\\":{\\"type\\":\\"sfixed64\\",\\"id\\":10,\\"comment\\":null},\\"sinteger32\\":{\\"type\\":\\"sint32\\",\\"id\\":11,\\"comment\\":null},\\"sinteger64\\":{\\"type\\":\\"sint64\\",\\"id\\":12,\\"comment\\":null},\\"str\\":{\\"type\\":\\"string\\",\\"id\\":13,\\"comment\\":null},\\"uinteger32\\":{\\"type\\":\\"uint32\\",\\"id\\":14,\\"comment\\":null},\\"uinteger64\\":{\\"type\\":\\"uint64\\",\\"id\\":15,\\"comment\\":null}},\\"comment\\":null},\\"Result\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Item\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"Example\\":{\\"methods\\":{\\"Get\\":{\\"requestType\\":\\"Item\\",\\"responseType\\":\\"Result\\",\\"comment\\":null}},\\"comment\\":null}}}"}]}) { query: Query } @@ -922,8 +922,8 @@ directive @stream( directive @transport(subgraph: String, kind: String, location: String, options: TransportOptions) repeatable on SCHEMA type Query { - Example_Get(input: Item_Input): Result @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example", methodName: "Get", responseStream: false) - Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "Example") + Example_Get(input: Item_Input): Result @grpcMethod(subgraph: "With All Values", rootJsonName: "Root0", objPath: "Example", methodName: "Get", responseStream: false) + Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "With All Values", rootJsonName: "Root0", objPath: "Example") } type Result { @@ -989,7 +989,7 @@ scalar TransportOptions" `; exports[`gRPC Handler Interpreting Protos should load the With Underscores proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"movie_request\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "With Underscores", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"movie_request\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query subscription: Subscription } @@ -1016,15 +1016,15 @@ directive @transport(subgraph: String, kind: String, location: String, options: type Query { """get all movies""" - io_xtech_Example_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) + io_xtech_Example_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.Example") """get all movies""" - io_xtech_AnotherExample_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) + io_xtech_AnotherExample_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) - io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") } """movie result message, contains list of movies""" @@ -1055,9 +1055,9 @@ The \`BigInt\` scalar type represents non-fractional signed whole numeric values scalar BigInt enum io__xtech__Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "With Underscores", value: "0") + ACTION @enum(subgraph: "With Underscores", value: "1") + DRAMA @enum(subgraph: "With Underscores", value: "2") } input io__xtech__movie_request_Input { @@ -1094,16 +1094,16 @@ enum ConnectivityState { type Subscription { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "With Underscores", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" `; exports[`gRPC Handler Load proto with prefixQueryMethod should load the retrieve-movie.proto 1`] = ` -"schema @transport(subgraph: "grpc", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"movie_request\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"movie_request_by_ids\\":{\\"fields\\":{\\"movieIds\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"RetrieveMovies\\":{\\"requestType\\":\\"movie_request_by_ids\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"RetrieveMovies\\":{\\"requestType\\":\\"movie_request_by_ids\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { +"schema @transport(subgraph: "prefixQueryMethod", kind: "grpc", location: "localhost", options: {requestTimeout: 200000, roots: [{name: "Root0", rootJson: "{\\"options\\":{\\"syntax\\":\\"proto3\\"},\\"nested\\":{\\"io\\":{\\"nested\\":{\\"xtech\\":{\\"nested\\":{\\"Genre\\":{\\"values\\":{\\"UNSPECIFIED\\":0,\\"ACTION\\":1,\\"DRAMA\\":2},\\"comment\\":null,\\"comments\\":{\\"UNSPECIFIED\\":null,\\"ACTION\\":null,\\"DRAMA\\":null}},\\"Movie\\":{\\"fields\\":{\\"name\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null},\\"year\\":{\\"type\\":\\"int32\\",\\"id\\":2,\\"comment\\":null},\\"rating\\":{\\"type\\":\\"float\\",\\"id\\":3,\\"comment\\":null},\\"cast\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":4,\\"comment\\":\\"list of cast\\"},\\"time\\":{\\"type\\":\\"google.protobuf.Timestamp\\",\\"id\\":5,\\"comment\\":null},\\"genre\\":{\\"type\\":\\"Genre\\",\\"id\\":6,\\"comment\\":null}},\\"comment\\":\\"movie message payload\\"},\\"EmptyRequest\\":{\\"fields\\":{},\\"comment\\":null},\\"movie_request\\":{\\"fields\\":{\\"movie\\":{\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"movie_request_by_ids\\":{\\"fields\\":{\\"movieIds\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"SearchByCastRequest\\":{\\"fields\\":{\\"castName\\":{\\"type\\":\\"string\\",\\"id\\":1,\\"comment\\":null}},\\"comment\\":null},\\"MoviesResult\\":{\\"fields\\":{\\"result\\":{\\"rule\\":\\"repeated\\",\\"type\\":\\"Movie\\",\\"id\\":1,\\"comment\\":\\"list of movies\\"}},\\"comment\\":\\"movie result message, contains list of movies\\"},\\"Example\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"RetrieveMovies\\":{\\"requestType\\":\\"movie_request_by_ids\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null},\\"AnotherExample\\":{\\"methods\\":{\\"GetMovies\\":{\\"requestType\\":\\"movie_request\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get all movies\\"},\\"RetrieveMovies\\":{\\"requestType\\":\\"movie_request_by_ids\\",\\"responseType\\":\\"MoviesResult\\",\\"comment\\":\\"get movies\\"},\\"SearchMoviesByCast\\":{\\"requestType\\":\\"SearchByCastRequest\\",\\"responseType\\":\\"Movie\\",\\"responseStream\\":true,\\"comment\\":\\"search movies by the name of the cast\\"}},\\"comment\\":null}}}}},\\"google\\":{\\"nested\\":{\\"protobuf\\":{\\"nested\\":{\\"Timestamp\\":{\\"fields\\":{\\"seconds\\":{\\"type\\":\\"int64\\",\\"id\\":1},\\"nanos\\":{\\"type\\":\\"int32\\",\\"id\\":2}},\\"comment\\":null}}}}}}}"}]}) { query: Query mutation: Mutation subscription: Subscription @@ -1131,15 +1131,15 @@ directive @transport(subgraph: String, kind: String, location: String, options: type Query { """get all movies""" - io_xtech_Example_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) + io_xtech_Example_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "GetMovies", responseStream: false) """get movies""" - io_xtech_Example_RetrieveMovies(input: io__xtech__movie_request_by_ids_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "RetrieveMovies", responseStream: false) - io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example") + io_xtech_Example_RetrieveMovies(input: io__xtech__movie_request_by_ids_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "RetrieveMovies", responseStream: false) + io_xtech_Example_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.Example") """get all movies""" - io_xtech_AnotherExample_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) + io_xtech_AnotherExample_GetMovies(input: io__xtech__movie_request_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "GetMovies", responseStream: false) """get movies""" - io_xtech_AnotherExample_RetrieveMovies(input: io__xtech__movie_request_by_ids_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "RetrieveMovies", responseStream: false) - io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") + io_xtech_AnotherExample_RetrieveMovies(input: io__xtech__movie_request_by_ids_Input): io__xtech__MoviesResult @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "RetrieveMovies", responseStream: false) + io_xtech_AnotherExample_connectivityState(tryToConnect: Boolean): ConnectivityState @grpcConnectivityState(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample") } """movie result message, contains list of movies""" @@ -1170,9 +1170,9 @@ The \`BigInt\` scalar type represents non-fractional signed whole numeric values scalar BigInt enum io__xtech__Genre { - UNSPECIFIED @enum(subgraph: "grpc", value: "0") - ACTION @enum(subgraph: "grpc", value: "1") - DRAMA @enum(subgraph: "grpc", value: "2") + UNSPECIFIED @enum(subgraph: "prefixQueryMethod", value: "0") + ACTION @enum(subgraph: "prefixQueryMethod", value: "1") + DRAMA @enum(subgraph: "prefixQueryMethod", value: "2") } input io__xtech__movie_request_Input { @@ -1209,9 +1209,9 @@ enum ConnectivityState { type Mutation { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): [io__xtech__Movie] @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } input io__xtech__SearchByCastRequest_Input { @@ -1220,9 +1220,9 @@ input io__xtech__SearchByCastRequest_Input { type Subscription { """search movies by the name of the cast""" - io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_Example_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.Example", methodName: "SearchMoviesByCast", responseStream: true) """search movies by the name of the cast""" - io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "grpc", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) + io_xtech_AnotherExample_SearchMoviesByCast(input: io__xtech__SearchByCastRequest_Input): io__xtech__Movie @grpcMethod(subgraph: "prefixQueryMethod", rootJsonName: "Root0", objPath: "io.xtech.AnotherExample", methodName: "SearchMoviesByCast", responseStream: true) } scalar TransportOptions" diff --git a/packages/legacy/handlers/grpc/test/handler.spec.ts b/packages/legacy/handlers/grpc/test/handler.spec.ts index 7f9c246f678fa..5c3fff64b8183 100644 --- a/packages/legacy/handlers/grpc/test/handler.spec.ts +++ b/packages/legacy/handlers/grpc/test/handler.spec.ts @@ -48,7 +48,7 @@ describe('gRPC Handler', () => { }; using cache = new InMemoryLRUCache(); const handler = new GrpcHandler({ - name: Date.now().toString(), + name, config, cache, pubsub, @@ -81,7 +81,7 @@ describe('gRPC Handler', () => { }; using cache = new InMemoryLRUCache(); const handler = new GrpcHandler({ - name: Date.now().toString(), + name: 'prefixQueryMethod', config, cache, pubsub, diff --git a/packages/legacy/utils/src/with-cancel.ts b/packages/legacy/utils/src/with-cancel.ts index 037f7f1b5a29f..b031fdc478812 100644 --- a/packages/legacy/utils/src/with-cancel.ts +++ b/packages/legacy/utils/src/with-cancel.ts @@ -1,6 +1,6 @@ export function withCancel>( asyncIterable: TAsyncIterable, - onCancel: () => void, + onCancel: (value?: any) => void, ): AsyncIterable { return new Proxy(asyncIterable, { get(asyncIterable, prop) { @@ -9,10 +9,10 @@ export function withCancel>( const asyncIterator = asyncIterable[Symbol.asyncIterator](); return { next: asyncIterator.next ? (...args) => asyncIterator.next(...args) : undefined, - return: async (...args) => { - onCancel(); + return: async value => { + onCancel(value); if (asyncIterator.return) { - return asyncIterator.return(...args); + return asyncIterator.return(value); } return { value: undefined, diff --git a/packages/loaders/grpc/src/grpcLoaderHelper.ts b/packages/loaders/grpc/src/grpcLoaderHelper.ts index fb82d843a5467..80d156d1e0b41 100644 --- a/packages/loaders/grpc/src/grpcLoaderHelper.ts +++ b/packages/loaders/grpc/src/grpcLoaderHelper.ts @@ -26,7 +26,7 @@ import { stringInterpolator } from '@graphql-mesh/string-interpolation'; import type { Logger, YamlConfig } from '@graphql-mesh/types'; import { GraphQLStreamDirective, type MaybePromise } from '@graphql-tools/utils'; import { credentials, type ChannelCredentials } from '@grpc/grpc-js'; -import { AsyncDisposableStack } from '@whatwg-node/disposablestack'; +import { DisposableStack } from '@whatwg-node/disposablestack'; import { EnumDirective, grpcConnectivityStateDirective, @@ -45,18 +45,15 @@ type DecodedDescriptorSet = Message & IFileDescriptorSet; const QUERY_METHOD_PREFIXES = ['get', 'list', 'search']; -export class GrpcLoaderHelper implements AsyncDisposable { +export class GrpcLoaderHelper extends DisposableStack { private schemaComposer = new SchemaComposer(); - private asyncDisposableStack = new AsyncDisposableStack(); constructor( private subgraphName: string, private baseDir: string, private logger: Logger, private config: YamlConfig.GrpcHandler, - ) {} - - [Symbol.asyncDispose]() { - return this.asyncDisposableStack.disposeAsync(); + ) { + super(); } async buildSchema() { @@ -84,6 +81,7 @@ export class GrpcLoaderHelper implements AsyncDisposable { this.logger.debug(`Getting channel credentials`); const creds = await this.getCredentials(); + this.defer(() => creds._unref()); this.logger.debug(`Getting stored root and decoded descriptor set objects`); const descriptorSets = await this.getDescriptorSets(creds); @@ -141,7 +139,7 @@ export class GrpcLoaderHelper implements AsyncDisposable { const reflectionEndpoint = stringInterpolator.parse(this.config.endpoint, { env: process.env }); this.logger.debug(`Creating gRPC Reflection Client`); const reflectionClient = new Client(reflectionEndpoint, creds); - this.asyncDisposableStack.defer(() => reflectionClient.grpcClient.close()); + this.defer(() => reflectionClient.grpcClient.close()); return reflectionClient.listServices().then(services => (services.filter(service => service && !service?.startsWith('grpc.')) as string[]).map( service => { diff --git a/packages/loaders/grpc/src/index.ts b/packages/loaders/grpc/src/index.ts index 2a46f71968b74..2c57798c3616f 100644 --- a/packages/loaders/grpc/src/index.ts +++ b/packages/loaders/grpc/src/index.ts @@ -7,8 +7,12 @@ interface LoaderContext { } export function loadGrpcSubgraph(name: string, options: YamlConfig.GrpcHandler) { - return (ctx: LoaderContext) => ({ - name, - schema$: new GrpcLoaderHelper(name, ctx.cwd, ctx.logger, options).buildSchema(), - }); + return (ctx: LoaderContext) => { + const helper = new GrpcLoaderHelper(name, ctx.cwd, ctx.logger, options); + const schema$ = helper.buildSchema().finally(() => helper.dispose()); + return { + name, + schema$, + }; + }; } diff --git a/packages/transports/grpc/src/index.ts b/packages/transports/grpc/src/index.ts index 29a7bbcdc6a4a..2baf4a821abd9 100644 --- a/packages/transports/grpc/src/index.ts +++ b/packages/transports/grpc/src/index.ts @@ -29,6 +29,7 @@ import { fromJSON } from '@grpc/proto-loader'; import { DisposableStack } from '@whatwg-node/disposablestack'; import { addExecutionLogicToScalar, addMetaDataToCall } from './utils.js'; import './patchLongJs.js'; +import { makeDisposable } from '@graphql-mesh/utils'; /** * SSL Credentials @@ -213,6 +214,13 @@ export class GrpcTransportHelper extends DisposableStack { const transportDirective = getDirective(schema, schema, 'transport'); if (transportDirective) { for (const directive of transportDirective) { + if ( + directive?.subgraph != null && + this.subgraphName != null && + directive.subgraph !== this.subgraphName + ) { + continue; + } if (directive?.options?.roots) { roots = directive.options.roots; break; @@ -236,6 +244,13 @@ export class GrpcTransportHelper extends DisposableStack { const directives = getDirectives(schema, field); if (directives?.length) { for (const directiveObj of directives) { + if ( + this.subgraphName && + directiveObj.args?.subgraph && + directiveObj.args.subgraph !== this.subgraphName + ) { + continue; + } switch (directiveObj.name) { case 'grpcMethod': { const { rootJsonName, objPath, methodName, responseStream } = directiveObj.args; @@ -256,9 +271,7 @@ export class GrpcTransportHelper extends DisposableStack { methodName, isResponseStream: responseStream, }); - field.resolve = function identityFn(root) { - return root; - }; + field.resolve = identityFn; } else { field.resolve = this.getFieldResolver({ client, @@ -330,7 +343,11 @@ export default { ); return mapMaybePromise(transport.getCredentials(), creds => { transport.processDirectives({ schema: subgraph, creds }); - return createDefaultExecutor(subgraph); + return makeDisposable(createDefaultExecutor(subgraph), () => transport.dispose()); }); }, } satisfies Transport; + +function identityFn(obj: T): T { + return obj; +} diff --git a/packages/transports/grpc/src/utils.ts b/packages/transports/grpc/src/utils.ts index 60f82056e0cb3..ffe5cd7909ca9 100644 --- a/packages/transports/grpc/src/utils.ts +++ b/packages/transports/grpc/src/utils.ts @@ -60,9 +60,9 @@ export function addMetaDataToCall( ); if (isResponseStream) { let isCancelled = false; - const responseStreamWithCancel = withCancel(call, () => { + const responseStreamWithCancel = withCancel(call, reason => { if (!isCancelled) { - call.call?.cancelWithStatus(0, 'Cancelled by GraphQL Mesh'); + call.call?.cancelWithStatus(0, reason?.toString() || 'aborted'); isCancelled = true; } });