Skip to content

Instantly share code, notes, and snippets.

@dlbnco
Last active September 11, 2018 21:29
Show Gist options
  • Save dlbnco/5949ebc6b9c68d7f90bdc8bbd700c222 to your computer and use it in GitHub Desktop.
Save dlbnco/5949ebc6b9c68d7f90bdc8bbd700c222 to your computer and use it in GitHub Desktop.
import axios from 'axios';
import { print } from 'graphql';
import gql from 'graphql-tag';
import apiUrl from '../config';
const GET_CANDY = gql`
query candy (
$name: String
) {
candy (
name: $name
) {
id
name
effects
}
}`;
axios({
method: 'post',
url: apiUrl,
data: {
query: print(GET_CANDY),
variables: {
name: candyNameFilter,
}
}
}).then(() => {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment