-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Overview
The Program Service was originally written to use GRPC for all requests, but this has been re-implemented as a RESTful API.
The Platform Gateway API has integrations with the program service that connect to the original GRPC. We want to update this connection to use the new RESTful services.
Program Service Swagger: https://program-service.dev.argo.cancercollaboratory.org/swagger-ui/index.html
Platform API - ProgramService GRPC client: https://github.com/icgc-argo/platform-api/blob/develop/src/services/programService/grpcClient.js
Platform API - ProgramService httpClient: https://github.com/icgc-argo/platform-api/blob/develop/src/services/programService/httpClient.js
The Platform UI uses the Gateway's GQL server to fetch program data. This interface can remain unchanged. What needs to be updated are the GQL resolvers. We need to update them to use the RESTful endpoints to retrieve the program data.
Platform API - ProgramService GQL resolvers: https://github.com/icgc-argo/platform-api/blob/develop/src/schemas/Program/index.js
Details
Each ticket in this epic will address a single query or resolver from the gql schema. In that ticket two steps will be necessary
- Create a function in the httpClient to interact with the ProgramService for the given action.
- Update the gql resolver to use the httpClient function from step 1 instead of the GRPC client.
One additional change will be the removal of the region property. There will be one ticket to remove this property from the GQL schema and remove the dedicated resolvers. A new epic will be opened following this one to replace the regions with a new DataCenter concept.
One final ticket will be added to remove the GRPC client code.
Query Resolvers
There are 3 which have a dedicated resolver. The ProgramOptions query has separate resolvers for each property of in the ProgramOptions type. Finally, the Program property users has a dedicated resolver.
program(shortName: String!)Get Program by Short NameprogramsList all ProgramsgetJoinProgramInvite(id: ID!)Get details about a program invite by invite ID
ProgramOptions Resolvers:
ProgramOptions.cancerTypesList all cancer type optionsProgramOptions.primarySitesList all primary site optionsProgramOptions.institutionsList all institutions optionsProgramOptions.countriesList all country options
Promam.users resolver:
Program.users(shortName: string)Get all users for a given program.
Mutation Resolvers
There are 6 mutations that each have dedicated resolvers and associated REST endpoints:
createProgram(program: ProgramInput!)Given all the required inputs for a program, request the creation of a new program.updateProgram(shortName: String!, updates: UpdateProgramInput!)Update a program identified byshortNameinviteUser(invite: InviteUserInput!)Create an invite to work as a contributor to a programjoinProgram(join: JoinProgramInput!)Accept an invite to join a programupdateUser(userEmail: String!, programShortName: String!, userRole: UserRole!)Make changes to an existing user inviteremoveUser(userEmail: String!, programShortName: String!)Remove user as a contributor to a program.