Update Platform API -> Program Service
integration to REST API
#674
Labels
Platform API -> Program Service
integration to REST API
#674
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
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 newDataCenter
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, theProgram
propertyusers
has a dedicated resolver.program(shortName: String!)
Get Program by Short Nameprograms
List all ProgramsgetJoinProgramInvite(id: ID!)
Get details about a program invite by invite IDProgramOptions Resolvers:
ProgramOptions.cancerTypes
List all cancer type optionsProgramOptions.primarySites
List all primary site optionsProgramOptions.institutions
List all institutions optionsProgramOptions.countries
List all country optionsPromam.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 byshortName
inviteUser(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.The text was updated successfully, but these errors were encountered: