Skip to content

Commit

Permalink
feat(rpc): updates to use latest core api
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Nov 12, 2019
1 parent 2c90093 commit 4962855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/rpc/src/reproduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,19 @@ export async function reproduce(

const implementation = collections(
toImplementation(await collection, (service, info) => {
const { types } = service;
if (isServiceQuery(service)) {
return query({
types,
...service,
resolve: (data: any) => client.unary(info.route.join(':'), data)
});
} else if (isServiceMutation(service)) {
return mutation({
types,
...service,
resolve: (data: any) => client.unary(info.route.join(':'), data)
});
} else if (isServiceSubscription(service)) {
return subscription({
types,
...service,
resolve: (data: any) => client.stream(info.route.join(':'), data)
});
} else {
Expand Down
4 changes: 3 additions & 1 deletion packages/rpc/src/server/RPCServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class RPCServer {
':fallback': {
declaration: {
kind: 'query',
types: { request: '', response: '', errors: {} }
request: '',
response: '',
errors: {}
},
resolve: app.fallback
},
Expand Down

0 comments on commit 4962855

Please sign in to comment.