Tag: apollo

将自定义types的列表传递给GraphQL变体

我的应用程序的目标是让用户能够保存和调用要填写和编辑的表单列表。 一个用户将有多种forms,一个表单将由其自己的几个领域组成。 如果我的types是这样设置的,例如: const FormType = new GraphQLObjectType({ name: 'FormType', fields: { id: { type: GraphQLID }, name: { type: GraphQLString }, email: { type: GraphQLString } } }); const UserType = new GraphQLObjectType({ name: 'UserType', fields: { id: { type: GraphQLID }, email: { type: GraphQLString }, firstName: { type: GraphQLString, default: '' }, […]

Apollo Graphql架构拼接冲突

我有一个关于GraphQL架构拼接的问题。 我有两个Graphql模式: type Name { firstname: String! lastname: String! } type Address { street: String! number: Int! } type User { name: Name! address: Address! } type Query { user(userId: String!): User } 和 type User { age: String! } type Query { user(userId: String!): User } 我现在尝试使用graphql-tools的mergeSchemas函数来合并模式: const schema = mergeSchemas({ schemas: [schema1, schema2] […]

GraphQL jsfile upload

我看到一些Relay的例子,但我使用Apollo的graphQL,找不到任何例子或文件如何通过变异处理file upload在GraphQL中?

订阅GraphQL Server时出错

我对GraphQl相当陌生,我在这里遵循GraphQL NodeJS后端教程: GraphQL实时订阅 。 一切运作良好,我完成了教程。 接下来我跟着阿波罗前端教程在这里VueJS: Vue&Apollo订阅 。 我从第一个教程中select使用自己创build的GraphQL服务器,而不是使用前端教程中使用的GraphCool。 这是我卡住的部分。 如果我打电话 subscription { Link(filter: { mutation_in: [CREATED] }) { node { id url description } } } 在GraphiQL客户端中,当我使用数据data: Link: node: {id: "59ef0bbeef32bb05692ee4b4", url: "http://new-test-url2.com", description: "Test description2"}在不同的浏览器选项卡中创build一个新的链接时,我获得了id , url和description data: Link: node: {id: "59ef0bbeef32bb05692ee4b4", url: "http://new-test-url2.com", description: "Test description2"} (此订阅调用也在后端教程中进行)。 但是当我打电话 subscription { Link(filter: { […]

不能从apollo-client导入createBatchingNetworkInterface

我正在尝试将graphql与我的vue项目集成。 我按照这些说明: https : //github.com/Akryum/vue-apollo 我有npm根据需要安装“apollo-client”,但由于某种原因,我不能导入“createBatchingNetworkInterface”。 这是我的main.js文件: import Vue from 'vue' import { ApolloClient, createBatchingNetworkInterface } from 'apollo-client' import VueApollo from 'vue-apollo' import App from './App' import router from './router' 这是我的apollo-client的index.d.ts文件: export { print as printAST } from 'graphql/language/printer'; export { ObservableQuery, FetchMoreOptions, UpdateQueryOptions, ApolloCurrentResult } from './core/ObservableQuery'; export { WatchQueryOptions, MutationOptions, SubscriptionOptions, FetchPolicy, FetchMoreQueryOptions, […]