Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose VA API via GraphQL #1132

Closed
mattsolo1 opened this issue Jul 13, 2023 · 11 comments · Fixed by #1426
Closed

Expose VA API via GraphQL #1132

mattsolo1 opened this issue Jul 13, 2023 · 11 comments · Fixed by #1426
Assignees

Comments

@mattsolo1
Copy link
Contributor

No description provided.

@mattsolo1
Copy link
Contributor Author

@phildarnowsky-broad
Copy link
Contributor

thanks @mattsolo1 good idea to put the reference links in here

@mattsolo1
Copy link
Contributor Author

Related info on the VRS REST API: https://github.com/broadinstitute/gnomad-browser-team/issues/43

@mattsolo1
Copy link
Contributor Author

mattsolo1 commented Jul 13, 2023

The gnomad_methods code provides a clue on what kind of GraphQL arguments we may want to expose to users:

https://github.com/broadinstitute/gnomad_methods/blob/514f634bd4cf31dcdb80a302ac7ba2caeeefffb0/gnomad/resources/grch38/gnomad.py#L530

For now we don't need to support interval queries. Just single variants.

I think the main GraphQL arguments users will be concerned with are by_ancestry_group and by_sex, so we'll want to expose these. They may also want to be able to specify which specific ancestry groups to return (as opposed to getting all of them).

@phildarnowsky-broad
Copy link
Contributor

One small note on this, since the focus is really on VA data more than VRS, I'm going to start calling this the "VA API" for better clarity.

@phildarnowsky-broad phildarnowsky-broad changed the title Expose VRS API via GraphQL Expose VA API via GraphQL Jul 26, 2023
@phildarnowsky-broad
Copy link
Contributor

@mattsolo1 am I missing something, or does the REST API not have a way to specify by_ancestry_group and by_sex parameters?

@phildarnowsky-broad
Copy link
Contributor

@mattsolo1 also the data returned by the API doesn't conform to the schema: in particular, it's missing the type fields, which we're going to need on the GraphQL end.

@phildarnowsky-broad
Copy link
Contributor

@mattsolo1 regarding the type fields, I did think of a way to work around not having those in the response from the REST API if that's not possible, but it would make things much simpler on this end if we did have them.

@mattsolo1
Copy link
Contributor Author

does the REST API not have a way to specify by_ancestry_group and by_sex parameters?

Not yet.. I still need to add this (should be straightforward).

in particular, it's missing the type fields, which we're going to need on the GraphQL end

Didn't realize this was missing; the REST API is passing along everything I'm getting from the hail lookup, so it must not be returned from this. I'll look into why this is.

@phildarnowsky-broad
Copy link
Contributor

phildarnowsky-broad commented Jul 27, 2023

@mattsolo1 looking more closely, it may only be the top-level VRS object that's missing its type, but generally speaking we'll need that anywhere in the data where we have a field that can have one of multiple types--that type from the incoming data will eventually determine the __typename that GraphQL will put in its responses so that clients will in turn know what concrete type is being used.

@phildarnowsky-broad
Copy link
Contributor

Upstream APIs are returning bad data, Dan M. in process of fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants