phac-nml / irida-next

IRIDA Next
https://phac-nml.github.io/irida-next/
Apache License 2.0
8 stars 2 forks source link

GraphQL: Add projectSample query [DFCT0010065] #620

Closed ericenns closed 1 month ago

ericenns commented 1 month ago

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR adds in a new query named projectSample which returns a Sample if found within a Project. The query find the Sample by either its puid or its name.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Launch server and login as your preferred user
  2. Navigate to GraphiQL endpoint (e.g. http://localhost:3000/graphiql)
  3. Try the projectSample query using sample puid
    {
    projectSample(projectPuid: "PROJECT_PUID", samplePuid: "SAMPLE_PUID") {
    name
    puid
    }
    }
  4. Try the projectSample query using sample name
    {
    projectSample(projectPuid: "PROJECT_PUID", sampleName: "SAMPLE NAME") {
    name
    puid
    }
    }
  5. Try querying for a Sample which belongs to a different project and ensure no result

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

ksierks commented 1 month ago

I tried it out and it works for me!

github-actions[bot] commented 1 month ago

Simplecov Report

Covered Threshold
92.31% 90%