Skip to content

Update type fields to use union types / interfaces #154

@alancleary

Description

@alancleary

Currently the GraphQL types are basically a verbatim implementation of the InterMine types. This means certain types contain fields that are mutually exclusive. For example, the Trait type can have a value for its qtlStudy field or its gwas field, but not both. The canonical way to handle this in GraphQL is to use a single field with a union or interface as its type. This will make the semantics of our GraphQL API more obvious and simplify client code that uses these types while enabling canonical functionality, e.g. filtering queries/results by type.

<edits>

  1. Commit 24e8445 adds the necessary resolver support
  2. Commit 103f5c8 adds support for format=jsonobjects queries, which is required to recover model class information from query responses

</edits>

The following types should be updated to use this approach:

  • Location: chromsome/supercontig -> locatedOn Commits e65b104 and bcc8c50
  • Location: feature Commit 4c41818
  • Trait: qtlStudy/gwas -> study; remove qlts and gwasResults since they can be accessed via study
  • DataSet: bioEntities; already generalized to type [BioEntity!]! but not implemented correctly
  • SequenceFeature:
    • childFeatures and overlappingFeatures; both fields are already generalized to type [SequenceFeature!]! but are not implemented correctly
    • chromsomeLocation/supercontigLocation -> location
    • chromsome and supercontig can be removed because they will be accessible via location.locatedOn
  • ExpressionValue: feature; already generalized to type SequenceFeature but not implemented correctly
  • PanGeneSets: transcripts; already generalized to type [Transcript!]! but not implemented correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions