【发布时间】:2019-10-24 09:24:44
【问题描述】:
我正在开发一个通过 CRA 提升的 React 项目。我正在使用 prisma cloud,它为我生成基本查询、突变等,这很好但还不够:(。我想知道是否可以将我的自定义解析器添加到 prisma-schema.js 中已经内置的解析器中。如果是这样,在哪里以及如何添加它们?
import { HttpLink } from "apollo-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
const client = new ApolloClient({
// By default, this client will send queries to the
// `/graphql` endpoint on the same host
// Pass the configuration option { uri: YOUR_GRAPHQL_API_URL } to the `HttpLink` to connect
// to a different host
link: new HttpLink({
uri: "https://eu1.prisma.sh/xxx/xxx/dev"
}),
cache: new InMemoryCache()
});
export default client;
我的期望是能够同时 - 将自定义字段添加到当前查询 - 进行自定义查询。
【问题讨论】: