frankcollins3 / PHPokedex

react concepts
0 stars 0 forks source link

graphQL [12:51pm] #24

Closed frankcollins3 closed 1 year ago

frankcollins3 commented 1 year ago

Screen Shot 2023-05-08 at 12 48 20 PM

Screen Shot 2023-05-08 at 12 48 25 PM

Screen Shot 2023-05-08 at 12 48 36 PM

in this instance: the API is created with: app.use('/pokemon)

that creates the first endpoint.

const response = await fetch(http://localhost:5000/pokemon?query={books}); I mistakenly queried the books to this above path. Thats the point of HTTP. The default way of doing things brings in all the data.

query={books}{name} you need the endpoints from books to come back. you cant return undestructured data if thats how you would explain it. That is the whole point of defining them on the client