0
親ソースが異なるソースと異なるシェイプから来ているときにフィールドリゾルバを書き込もうとするときに問題があります。私は、次のスキーマ持っていると仮定すると例えばGraphQL解決マッピング
、:
type Person
id : Number
fullname : String
type Story:
title : String
author : Person
Query:
getPersonById(id: Number) : Person # makes db call.
getStoryById(id: Number) : Story # gets the story somehow.
さて、問題は物語の作者リゾルバであるが、それが返す値は次のとおりです。
はgetPersonByIdを返し{ id: 1, first_name: "Jack" last_name: "Hugh" }
ながら:
{ id: 1, firstName: "Jack", lastName: "Hugh" }
今、PersonのfullNameの作業リゾルバをthとして書くことができませんソースのフィールド名が異なっています。
あなたは何をお勧めしますか?
ありがとうございます!