Custom InputTypes with react-apollo

Viewed 3095

I'm trying to execute a mutation query that requires a custom input type on the client. Currently it looks something like this:

import { graphql } from 'react-apollo';
...
const graphQuery = graphql(gql`
  input UserSignUpInput {
    firstName: String!,
    lastName: String!,
    email: String!,
    password: String!
  }
  mutation userSignUp($input: UserSignUpInput!) {
    createUserByEmail(input: $input) {
      authToken
    }
  }`, {
  props: ({ mutate }) => ({
    signup: (firstName, lastName, email, password) =>
      mutate({ variables: { input: { firstName, lastName, email, password } } }),
  }),
});
...

However I'm getting the error that I'm not allowed to define input types in the query. My question is: How do I define these complex input types? It doesn't seem like I'm able to provide a Schema to ApolloClient..

1 Answers
Related