graphql-tools

Does Apollo Server work with GraphQL Tools stitchSchemas?

ε祈祈猫儿з 提交于 2021-01-07 01:36:54
问题 According to Apollo docs "Apollo Server 2 exports all of graphql-tools, so makeExecutableSchema and other functions can be imported directly from Apollo Server." "Apollo Server is able to accept a schema that has been enabled by graphql-tools" However, I've just noticed I can't directly import stitchSchemas from apollo-server (I've been using it from @graphql-tools/stitch), and am hours deep in problems that aren't making sense. Does Apollo work with stitchSchemas or not? 回答1: Yes, you can

Does Apollo Server work with GraphQL Tools stitchSchemas?

冷暖自知 提交于 2021-01-07 01:33:16
问题 According to Apollo docs "Apollo Server 2 exports all of graphql-tools, so makeExecutableSchema and other functions can be imported directly from Apollo Server." "Apollo Server is able to accept a schema that has been enabled by graphql-tools" However, I've just noticed I can't directly import stitchSchemas from apollo-server (I've been using it from @graphql-tools/stitch), and am hours deep in problems that aren't making sense. Does Apollo work with stitchSchemas or not? 回答1: Yes, you can

Share common fields between Input and Type in GraphQL

拟墨画扇 提交于 2020-01-09 11:52:44
问题 I was wondering if there's a way to share the common fields between Input and Type in GraphQL so that I don't have to define the same set of fields in multiple places. Example: input PersonInput { id: String! name: String address: String } type Person { id: String! name: String address: String } I know Fragment might be a solution, but if my understanding is correct, using Fragment always requires you to put an ON condition which makes it look like this: Fragment PersonCommonFields on Person

Share common fields between Input and Type in GraphQL

£可爱£侵袭症+ 提交于 2020-01-09 11:52:24
问题 I was wondering if there's a way to share the common fields between Input and Type in GraphQL so that I don't have to define the same set of fields in multiple places. Example: input PersonInput { id: String! name: String address: String } type Person { id: String! name: String address: String } I know Fragment might be a solution, but if my understanding is correct, using Fragment always requires you to put an ON condition which makes it look like this: Fragment PersonCommonFields on Person

Share common fields between Input and Type in GraphQL

非 Y 不嫁゛ 提交于 2019-11-28 14:31:46
I was wondering if there's a way to share the common fields between Input and Type in GraphQL so that I don't have to define the same set of fields in multiple places. Example: input PersonInput { id: String! name: String address: String } type Person { id: String! name: String address: String } I know Fragment might be a solution, but if my understanding is correct, using Fragment always requires you to put an ON condition which makes it look like this: Fragment PersonCommonFields on Person { ... } There seems to be no way to specify "on Person/PersonInput". GraphQL fragments are for querying