Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GraphQL object fulfilled by querying two different data-stores; how to do this efficiently?

オープン
#307 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
fsharp, graphql

調査の方向性

Issue で言及されているエントリポイント Define.Object("Book", ...) から始め、周辺にあるオブジェクトとフィールドの解決に関するドキュメントまたは例を読んでください。高速フィールドのみを使用するクエリが fetchFastFields を使用し、低速フィールドを要求するクエリが fetchSlowFields を使用し、どちらの関数も Book ごとに 1 回を超えて呼び出されなければ、解決済みです。

索引モデルが issue の本文から書いたものです。

説明

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):

  • id
  • title
  • author
  • datePublished

The other fields are "big", and they are stored in a slow data-store (e.g. Amazon S3):

  • fullText
  • blurb

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 Book in a query, do not call fetchFastFields or fetchSlowFields more than once.

How should I write my Define.Object("Book", ... code to achieve this?

主要言語
F#
スター
406
フォーク
74
平均マージ
1日 8時間
マージ済み PR(30日)
14

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fsprojects/FSharp.Data.GraphQL のほかの issue

fsprojects/FSharp.Data.GraphQL の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。