Conversation
| const [searchLoading, setSearchLoading] = useState<boolean>(false); | ||
| const [queryType, setQueryType] = useState<'slurm' | 'osmp'>('osmp'); | ||
|
|
||
| const [id, setId] = useState<string>(''); |
There was a problem hiding this comment.
I still need a way to somehow pass the jobId from Slurm to the front-end. Any ideas?
There was a problem hiding this comment.
Didn't you make it part of OnSlurmResponse?
There was a problem hiding this comment.
Yeah, so the way this works is a little bit different.
When the page loads for the first time, useFetchVariantsSubscription will execute a subscription and starts listening for data from the server. If the server publishes data for the first time, useFetchVariantsSubscription will receive it. However, if the server publishes data for the second time, useFetchVariantsSubscription will actually still use the old data. The way Apollo subscription hook will "resubscribe" is when we pass in a different value in variables. That's why I'm passing a random number to the variables to trigger re-subscription. But ideally, we'd want to know the jobId in advance, which I haven't figured out how to do yet.
|
Note that it is strongly recommended to switch from |
The goals of this PR are:
echo Hello world!). Result can be seen on the working directory in the Slurm node.[PubSub class](https://www.apollographql.com/docs/apollo-server/data/subscriptions/#the-pubsub-class)is created to subscribe and publish results to the front end. See documentation here on how Subscriptions are created in GraphQL Apollo.Job Automation Flow

Before diving into the code, it is helpful to understand the high-level flow of this implementation.
getVariantResolver. If the gene size is >600,000bp, we submit a job request through the Slurm API. Currently, we are running a dummy job. The API does not actually kick-start the Nextflow job, though this will be integrated down the line.http://localhost:9821/auth/realms/ssmp/protocol/openid-connect/token(for local development), orhttps://keycloak.ccmdev.ca/auth/realms/ssmp/protocol/openid-connect/tokenin staging./graphqlis responsible for handling all inbound requests. A subscription class is created to receive the data and publish it to the front end.VariantQueryPagewill display the result from thequeryor the result from thesubscription. In the case of a subscription, the result returned by the query is an empty list, and the front end displays data that is pushed from the web socket server.