Closed frankcollins3 closed 1 year ago
"args is not defined" error (fixed): resolve: (parent, args)
const response = await axios.post('http://localhost:5000/pokemon?query={allDataAllPokemon(name:"slowpoke"){name,id,type}}');
the clientside fetch in which (name:"slowpoke") the name is the part of url path that is parsed as args.key:"value"
[1:56pm]
// const response = await axios.post('http://localhost:5000/pokemon', {
// query: `
// query allDataAllPokemon($name: String!) {
// pokemon(name: $name) {
// id
// name
// type
// }
// }
// `,
// variables: {
// name: 'slowpoke'
// }
// })
was trying to get a version of this code working and couldn't maybe it would work now [1:57pm]
response = await axios.post('url', { name: 'pikachu' }
here is the GraphQL resolve function![Screen Shot 2023-05-11 at 1 34 36 PM](https://github.com/frankcollins3/PHPokedex/assets/73137934/35e88521-fd19-405e-bbba-579e310d401f)