I am trying to write a simple query with optional filter params
For example
const query = gql`query FilteredPeople($email: String) {
people(email: $email) {
fullName
email
}
}`;
I keep getting
"Network error: The inline argument "email" is expected as a variable but was not provided."
It makes me think it’s on the server side, but my schema is pretty straightforward
const RootQuery = `
type RootQuery {
people(email: String): [Person]
}
`;
Looking at the graphql spec to specify if something is optional or not you use a !
. As you can see email is not required.
Note I am using apollo client/server and react-apollo. Versions on my
server
"graphql": "^0.7.2",
"graphql-server-express": "^0.4.3",
client
"apollo-client": "0.5.0",
"graphql-tag": "0.1.15",
"react-apollo": "0.5.16",
Am I missing something? I thought I fixed it, but it stopped working so I guess not.