GraphQL object fulfilled by querying two different data-stores; how to do this efficiently?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- fsharp, graphql
- Domain
- api, backend-api-design
Research direction
Start at the Define.Object("Book", ...) entry point mentioned in the issue and read the surrounding object and field-resolution documentation or examples. A solution is done when fast-only queries use fetchFastFields, queries requesting slow fields use fetchSlowFields, and neither function is called more than once per Book.
Written by the indexing model from the issue text.
Description
This is a question rather than an issue (although it could be turned into an issue if no good solution is found!)
Suppose I have a library of books:
type Book = {
id : ID!
title : String!
author : String!
datePublished : String!
fullText : String!
blurb : String!
}
Some of these fields are "small", and they are stored in a fast data-store (e.g. MySQL, Postgres):
idtitleauthordatePublished
The other fields are "big", and they are stored in a slow data-store (e.g. Amazon S3):
fullTextblurb
I have two functions for fetching the fields:
fetchFastFields : ID -> BookPropertiesFast
fetchSlowFields : ID -> BookPropertiesSlow
The behaviour I want on the back-end is:
- If the query can be fulfilled with only "fast" fields, call
fetchFastFields - If the query has one or more "slow" fields, call
fetchSlowFields - For each
Bookin a query, do not callfetchFastFieldsorfetchSlowFieldsmore than once.
How should I write my Define.Object("Book", ... code to achieve this?
- Dominant language
- F#
- Stars
- 406
- Forks
- 74
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 14
Contributor guide
No contributing guide indexed for this repository
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.
More from fsprojects/FSharp.Data.GraphQL
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
fsprojects/FSharp.Data.GraphQL#573 · 1 reaction · 2 assignees ·
-
FR: Suave package Open
fsprojects/FSharp.Data.GraphQL#566 · 1 comment · 1 reaction · 2 assignees ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
All issues in fsprojects/FSharp.Data.GraphQL
Similar issues
-
bug priority:normal ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenHands/extensions#626 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·