Closed evseevnn-zz closed 6 years ago
@evseevnn can you share your service schemas so I can check it out? You should be able to define as many as you want. If you can provide the use case that breaks it I can work on fixing!
@brad-decker Thank! Sure! Im just trying use 2 empty schemas in defferent services
type Query {
_id: ID!
}
type Mutation {
_id: ID!
}
type Subscription {
_id: ID
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
@evseevnn your Mutation type, and likely your query type as well are failing because they aren't being defined as an appropriate type. If you take a look at http://graphql.org/graphql-js/mutations-and-input-types/
Query and Mutation types should contain query definitions rather than field definitions.
Here's an example:
type Book {
id: Int,
title: String,
authorId: Int,
year: Int,
}
type Query {
book(id: Int!): Book,
books: [Book],
booksByAuthor(authorId: Int!): [Book],
}
input UpdateBookInput {
id: Int!
clientMutationId: Int!
title: String
}
type UpdateBookPayload {
book: Book
clientMutationId: Int
}
type Mutation {
updateBook(input: UpdateBookInput!): UpdateBookPayload,
}
Full disclosure i tested your use case on a version based on my pr #8 - so if you update your schema and still run into problems a new version is on its way that will address the issue.
@brad-decker Hi! I'm sorry that your time spent. No, trouble not in Mutation type, trouble in my code. Sorry again.
@brad-decker That happen when i trying start 2 services and every one has graphql schema. Can i do that or only one service can has it?