Use this tag for questions about graphql-compose, a toolkit for generating complex GraphQL schemas in Node.js.
Questions tagged [graphql-compose]
14 questions
3
votes
1 answer
Querying child node fields in Gatsby
I have the following GraphQL schema, which defines 3 types: a CondaPackage which hasmany CondaVersion, which hasmany CondaExecutable. I want to be able to query a CondaVersion and ask "how many CondaExecutables do you own which succeeded my…

Migwell
- 18,631
- 21
- 91
- 160
3
votes
1 answer
How to return custom object from resolver in graphql?
I have nodejs and graphql application.
My User Schema and resolver using graphql-compose-mongoose:
import { composeWithMongoose } from 'graphql-compose-mongoose';
const UserTC = composeWithMongoose(User, {
fields: { remove: ['password']…

Jon Sud
- 10,211
- 17
- 76
- 174
2
votes
2 answers
graphql-compose, trigger resolver of a nested field
I'm beginner in GraphQL and use it with Node and graphql-compose to create schemas.
I'm not sure if is the correct way to do that: AddressTC is reusable Type, when UserTC or another Type is created or updated, I want to trigger validation…

Rifton007
- 291
- 1
- 5
- 24
2
votes
1 answer
You try to generate GraphQL Type with name "Projects" from mongoose model but this type already exists in SchemaComposer
I use different mongodb db's to store the same mongoose schema records "Pages". Because of that i wanted to have X graphql endpoints - each should serve the "Pages" of the requested database.
Example: localhost:3000/graphql/:database
For that reason…

bschauer
- 958
- 9
- 33
1
vote
0 answers
GraphQL dependent query in gatsby page
I would like to nest two queries on my Gatsby index.js page. I have front matter on my posts that includes the name and directory of the featured image. Query #1 is to retrieve those strings and query #2 is to build a childImageSharp using a…

nicholas
- 180
- 2
- 9
1
vote
1 answer
Deleting _id from object coming from mongodb doesn't work
I am using graphql to get some data from mongodb database. So, I was making an api which on running saves data in main collection but also saves data in some other collection with a couple of more data. I was trying to delete _id from the data that…

Atin Singh
- 3,624
- 2
- 18
- 25
1
vote
0 answers
How to interept the result on graphql relations resolver with middleware in apollo server?
I have a graphql type UserReview and UserReply:
type UserReview {
_id
content
}
type UserReply {
_id
reviewId
content
}
I'm using graphql-compose to do add a relation between reviews and replies so that when querying a review I will also…

hitchhiker
- 1,099
- 5
- 19
- 44
1
vote
1 answer
How to use custom input type in graphql-compose?
I'm using mongodb and graphql-compose-mongoose in order to generate the Graphql schema. However I'm adding authentication mutations and I want to add graphql input for one of the queries. I saw in the documentation that args.filter can receive an…

hitchhiker
- 1,099
- 5
- 19
- 44
1
vote
1 answer
Why I get syntax error in graphql when I use enum in filter?
For every user has gender property. The gender property is enum in graphql.
I want to query all users that have female and male values only.
Why when I write my query on graphql playground I got an error message?
I also try to write:…

Jon Sud
- 10,211
- 17
- 76
- 174
0
votes
0 answers
How to move from schema stitching to federated subgraphs after upgrade of many libraries?
I need to move from schema stiching to federated subgraphs using graphql-compose, graphq-compose-mongoose, apollo-subgraph apollo-server after an upgrade of all the libraries
I have a gateway using apollo gateway that create a supergraphSDl using…

Anthony Levillon
- 11
- 3
0
votes
0 answers
graphql-compose-mongoose query with multiple enum field values
I have this enum:
enum Status {
DEAD
SICK
HEALTHY
}
Using that enum type, how can I query people that are alive (Sick and healthy)?
query GetPeopleByStatus($status: EnumStatus){
people: peopleMany(filter: { status: $status} })…

danielrvt
- 10,177
- 20
- 80
- 121
0
votes
1 answer
graphql-compose: require argument that's an input type
Below is an example of a resolver I'm writing that's using graphql-compose to help build up our schema.
const createResolver = schemaComposer.createResolver({
kind: 'mutation',
name: 'SomeNameHere',
type: SomeTypeNameTC,
args: {
…

joshft91
- 1,755
- 7
- 38
- 53
0
votes
1 answer
How to get all graphql schema query, mutation, subscribe
I am using nodejs with graphql and graphql-compose
so i define scheme as
schemaComposer.Query.addFields({
Me: MyResolvers,
Info: MyInfoResolvers,
Post: PostResolvers
})
schemaComposer.Mutation.addFields({
Login: MyLoginResolvers,
…

Peter Jack
- 847
- 5
- 14
- 29
0
votes
1 answer
graphql-compose: TypeError: Cannot read property 'getTypeName' of undefined
I am trying out graphql-compose library and following their Getting started Github page, I build a very simple example.
Here is my code:
import { schemaComposer } from "graphql-compose";
export const UserTC =…

TheSoul
- 4,906
- 13
- 44
- 74