pasing a variable in graphql query apollo code example
Example 1: appolo client variables pass
const query = gql`
query User($okta: String) {
User(okta: $okta){
id
}
}
`;
client.query({
query: query,
variables: {
okta: 'some string'
}
})
Example 2: appolo client variables pass
export default graphql(QueryTodos, {
options: (props) => ({ variables: { userId: props.userId } })
})( Home );