github.com/emcfarlane/larking@v0.0.0-20220605172417-1704b45ee6c3/testpb/starwars.proto.bckup (about) 1 // Copyright 2021 Edward McFarlane. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 syntax = "proto3"; 6 7 package larking.testpb; 8 9 // Implements https://relay.dev/docs/en/graphql-server-specification.html 10 11 message Faction { 12 option (larking.api.relay).node = { 13 rpc : "larking.testpb.StarWars.GetFaction(id : id)" 14 }; 15 16 string id = 1; 17 string name = 2; 18 19 option (larking.api.relay).connection = { 20 name : "ships" 21 rpc : "larking.testpb.StarWars.ListShips(faction_id : id)" 22 }; 23 } 24 25 message GetFactionRequest { string name = 1; } 26 27 message Ship { 28 option (larking.api.relay).node = { 29 rpc : "larking.testpb.StarWars.GetShip(id : id)" 30 }; 31 32 string id = 1; 33 string name = 2; 34 } 35 36 message ListShipsRequest { string faction_id = 1; } 37 38 message ListShipsResponse { 39 repeated Ship ships = 1; 40 bool has_next_page = 2; 41 bool has_previous_page = 3; 42 string start_cursor = 4; 43 string end_cursor = 5; 44 } 45 46 // type Query { 47 // rebels: Faction 48 // empire: Faction 49 // node(id: ID!): Node 50 //} 51 // 52 // type Mutation { 53 // introduceShip(input: IntroduceShipInput!): IntroduceShipPayload 54 //} 55 service StarWars { 56 57 rpc GetRebels(google.protobuf.Empty) returns (Faction) { 58 option (larking.api.relay) = { 59 query : "rebels" 60 }; 61 } 62 63 rpc GetFaction(GetFactionRequest) returns (Faction) { 64 option (larking.api.relay) = { 65 query : "rebels(name : 'rebels')" 66 }; 67 option (larking.api.relay) = { 68 "rebels"-> 69 name : "rebels" 70 } 71 } 72 73 rpc ListShips(ListShipsRequest) returns (ListShipsResponse) 74 }