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

remove API include requests #678

Open
camallen opened this issue Apr 10, 2019 · 3 comments
Open

remove API include requests #678

camallen opened this issue Apr 10, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@camallen
Copy link
Contributor

Avoid using include requests in the rebuild for API performance and an issue with incorrect data zooniverse/panoptes#3107

I think the only code location using them at the moment is here

const include = { include: 'avatar,background,owners,pages' }

@rogerhutchings
Copy link
Contributor

Is this a good place to use the GraphQL endpoint for projects?

@srallen srallen added the enhancement New feature or request label Apr 25, 2019
@srallen srallen added this to the Post-TESS milestone Apr 25, 2019
@eatyourgreens
Copy link
Contributor

include is also being used now to fetch subject sets for workflows.

async function fetchWorkflowData (activeWorkflows, env) {
const response = await panoptes
.get('/workflows', {
complete: false,
env,
fields: 'completeness,grouped',
id: activeWorkflows.join(','),
include: 'subject_sets'
})

@eatyourgreens
Copy link
Contributor

#2016 will remove included subject sets from project workflows.

eatyourgreens added a commit that referenced this issue Mar 19, 2021
Adds a query which gets available subject numbers, for a given workflow, from the Cellect API.
Removes included subject sets from the workflows API query (see #678.) Subject sets are fetched separately, by ID, from the Panoptes API. This increases the number of API requests required to build each page, but allows us to limit subject set requests to grouped workflows.
Updates the API mocks, in data-fetching tests, to include grouped/non-grouped cases and to add the /subject_sets endpoint.
Refactors data-fetching into `fetchWorkflowsHelper` and `fetchSubjectSets`.
Wraps the data-fetching requests in try/catch, so that we can log API errors to Sentry.

Co-authored-by: Shaun A. Noordin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants