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

Add support for GA4GH service info query #482

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Add support for GA4GH service info query #482

merged 4 commits into from
Feb 16, 2024

Conversation

acoffman
Copy link
Member

@acoffman acoffman commented Feb 16, 2024

This adds an initializer in config/initializers that will run at boot. It expects to find a data_version.yml at the root dir of the application. That file should contain a key version containing the current data version.

This will be loaded into a constant.

When generating a new data release, you will need to remember to update this value (so, if there are docs for the process somewhere, may be good to add this step to them). Its manual for now, but as we automate the data generation process, we should automate this too.

Additionally, I have added a top level serviceInfo query to the API containing all the fields needed for the GA4GH Service discovery spec. Though the query obviously looks different given it is GraphQL rather than REST, the response should be compliant with their schema.

updated_at and version information for this is pulled live from GitHub. (dataVersion is still handled as described above)

The query

{
  serviceInfo {
    id
    name
    type {
      group
      artifact
      version
    }
    description
    organization {
      name
      url
    }
    contactUrl
    documentationUrl
    createdAt
    updatedAt
    environment
    version
    dataVersion
  }
}

Will yield

{
  "data": {
    "serviceInfo": {
      "id": "org.dgidb.graphql",
      "name": "DGIdb",
      "type": {
        "group": "org.dgidb",
        "artifact": "DGIdb GraphQL",
        "version": "v.5.0.4"
      },
      "description": "An open-source search engine for drug-gene interactions and the druggable genome.",
      "organization": {
        "name": "Wagner and Griffith laboratories",
        "url": "https://dgidb.org/about#contact"
      },
      "contactUrl": "mailto:[email protected]",
      "documentationUrl": "https://dgidb.org/api/graphiql",
      "createdAt": "2023-10-20T08:51:00-05:00",
      "updatedAt": "2024-01-30T18:04:04+00:00",
      "environment": "development",
      "version": "v.5.0.4",
      "dataVersion": "Dec-2023"
    }
  }
}

closes #481

@acoffman acoffman changed the title Add basic support for querying current data version Add support for GA4GH service info query Feb 16, 2024
Copy link
Contributor

@mcannon068nw mcannon068nw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! query runs as intended locally. will defer to @ahwagner on the specification structure for a double check

Copy link
Member

@ahwagner ahwagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@acoffman acoffman merged commit d07c465 into dev Feb 16, 2024
4 checks passed
@acoffman acoffman deleted the dataset-version branch February 16, 2024 19:58
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.

3 participants