In the TodoInput component, there's a text input that allows the user to enter new todo items. When they're done entering the todo item, Apollo Client will need to send a mutation to the backend GraphQL server. Here's what the component code looks like:
import React, { Component } from 'react';
import { TextInput } from 'react-native';
import { Mutation } from '@apollo/react-components'
import styles from './styles';
import { GET_USER, ADD_TODO } from '../constants';
export default class App extends Component {
render() {
return (
<Mutation
mutation={ADD_TODO}
refetchQueries={[
{
query: GET_USER,
variables: {
userId: 'me'
}
}
]}
>
{addTodo => (
<TextInput
style={styles.textInput}
placeholder='What needs to be done?'
onSubmitEditing...