Closed RobertVillalba closed 6 months ago
The recommended way of doing this with GraphQXL would be to instead rely on the already existing composition mechanisms, for example:
# products.graphqxl
type _ProductsQuery {
product(id: ID!): Product
productByName(name: String!): Product
allProducts: [Product!]!
}
# users.graphqxl
type _UsersQuery {
user(id: ID!): User
userByName(name: String!): User
allUsers: [User!]!
}
# main.graphqxl
import 'products'
import 'users'
type Query {
..._ProductsQuery
..._UsersQuery
}
That way, it's very clear and explicit the order of the fields in the final Query
type.
Take a look at this example
Ah that makes perfect sense thank you!
I have multiple files with each extending the Query type and a base file with an empty Query.
When running the generator I get