parse-community / parse-community/parse-server
Expose options for generated queries in GraphQL server
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
If you are using the auto-generated resolvers from the included ParseGraphQLServer, there does not seem to be a way to set the read preference on these queries in bulk without affecting other queries. You can either:
- Include it in the database connection URL, thus affecting all queries
- Set it via GraphQL resolver
args, requiring it to be present in the query document.
Feature / Enhancement Description
- A top level default query options property on the
ParseGraphQLServer's config for settings likereadPreference - A query and/or resolver middleware property on
classConfigselements'queryproperty which allows mapping and modifying these queries or requests before they are executed
Example Use Case
We have an app where we would like to route JS SDK requests to a primary, and requests from the GQL API to secondary replicas. With the database url environment variable and the --mountGraphQL argument, we have no way to differentiate between these requests.
Alternatives / Workarounds
Deploying the parse server image with the read preference hardcoded in the connection string, then wrapping the SDK query constructor with one that sets the read preference back to primary (not ideal).
If you've read this far, thanks for your interest! Does this seem like a good idea? Is there a workaround I'm not thinking of?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing ParseGraphQLServer configuration, its auto-generated resolvers, and the classConfigs query path. Determine how query options and resolver requests currently reach execution, then confirm that the chosen design supports bulk defaults or middleware without changing other queries; the issue does not name specific files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript, node.js
- Domain
- api, backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100