Skip to content

GQL-113: Add new GraphQL query type for Citation #165

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

dmistry1
Copy link
Contributor

Overview

What is the feature?

Adds citation and citation draft

What areas of the application does this impact?

New queries and mutations for Citations

Testing

query Citation($params: CitationInput) {
  citation(params: $params) {
    name
    identifier
    identifierType
    resolutionAuthority
    relatedIdentifiers
    citationMetadata
    abstract
    scienceKeywords
    conceptId
    nativeId
  }
}
query Citations($params: CitationsInput) {
  citations(params: $params) {
    count
    cursor
    items {
      name
      identifier
      identifierType
      resolutionAuthority
      relatedIdentifiers
      citationMetadata
      abstract
      scienceKeywords
      conceptId
      nativeId
    }
  }
}
mutation IngestDraft($conceptType: DraftConceptType!, $metadata: JSON!, $nativeId: String!, $providerId: String!, $ummVersion: String!) {
  ingestDraft(conceptType: $conceptType, metadata: $metadata, nativeId: $nativeId, providerId: $providerId, ummVersion: $ummVersion) {
    conceptId
    revisionId
    warnings
    existingErrors
  }
}
mutation PublishDraft($draftConceptId: String!, $nativeId: String!, $ummVersion: String!) {
  publishDraft(draftConceptId: $draftConceptId, nativeId: $nativeId, ummVersion: $ummVersion) {
    conceptId
    revisionId
    warnings
    existingErrors
  }
}
mutation DeleteVisualization($providerId: String!, $nativeId: String!) {
  deleteVisualization(providerId: $providerId, nativeId: $nativeId) {
    conceptId
    revisionId
  }
}

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

})

const { data, errors } = response.body.singleResult
console.log("🚀 ~ test ~ errors:", errors)
Copy link
Member

Choose a reason for hiding this comment

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

debug

getPermittedJsonSearchParams() {
return [
...super.getPermittedJsonSearchParams(),
'author-name',
Copy link
Member

Choose a reason for hiding this comment

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

Wanted to confirm the hyphens are intentional.

Copy link
Contributor Author

@dmistry1 dmistry1 May 22, 2025

Choose a reason for hiding this comment

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

That should be _. Fixed.

Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6fd2d6d) to head (f0192ef).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #165   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          109       112    +3     
  Lines         2509      2551   +42     
  Branches       287       288    +1     
=========================================
+ Hits          2509      2551   +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

/**
* Returns an array of keys representing supported search params for the json endpoint
*/
getPermittedJsonSearchParams() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are you getting this list of values? I can't find documentation on what search params are supported. I can't find any CMR documentation on citations, only drafts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got these values from CMR Repo. CMR is missing the documentation for Citation, I filed a ticket to have documentation added: https://bugs.earthdata.nasa.gov/browse/CMR-10583

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks

fetchUmm(searchParams, ummKeys, headers) {
const ummHeaders = {
...headers,
Accept: 'application/vnd.nasa.cmr.umm_results+json'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have a version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

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