I get the error message "Cannot query field "available" on type "Query" when I try to fetch all products including the available property.
Query call
const res = await fetch(`graphql?query={products{
id
name
available
}}`);
Schema
export default `
type Product {
id: ID!
name: String!
available: [Available]
}
type Available {
stock: String
size: String
}
input AvailableInput {
stock: String
size: String
}
type Query {
product(name: String!): Product
products: [Product]
}
type Mutation {
addProduct(name: String! available:[AvailableInput] ): Product
}
`;