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

Adding support for Sequence Coord API #46

Open
wants to merge 12 commits into
base: staging
Choose a base branch
from
Open

Conversation

ivana-truong
Copy link
Collaborator

@ivana-truong ivana-truong commented Dec 19, 2024

  • Edited construct_query in seq_schema.py
    • Changed return value of function to JSON rather than just GraphQL string. Sequence API requires a JSON query
      for requests
    • Wrote/moved code into helper functions: _merge_query_list, _merge_query, merge_dicts, idxs_to_idx_dict,
      _idx_dict_to_name_dict, query_dict_to_graphql_string
    • Added support for field arguments. This is done by adding args as an attribute to FieldNode and checking for
      matching user input during query construction.
  • Added test_seq_query.py with basic tests for each query type
  • Added seq_query.py
    • Each query type (GraphQL type under Query root) is implemented as a dataclass inheriting from abstract class
      Query (similar to search api package)
    • Query args are class attributes that get passed as a dict into construct_query
  • NOTE: did some quick edits and it seems like seq_schema and data_schema could be merged pretty easily

TO DO:

  • The way query_dict_to_graphql_string works is a bit janky. Probably find a cleaner way. Maybe using a class that inherits from dict and overwrites some of the string representation.
  • How field arguments are passed in is flawed. They are currently attributes in the query dataclasses and this would be problematic if redundantly named field args were added in the future. Other options detailed in code.

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 this pull request may close these issues.

1 participant