parse-community / parse-community/parse-server

Expose options for generated queries in GraphQL server

Open
#8,768 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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 like readPreference
  • A query and/or resolver middleware property on classConfigs elements' query property 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.