We will have our queries only hit get endpoints, and have the ability to delete and update players for our React Native, and React app.

Photo by Vishnu R Nair on Unsplash
Update your Player object type.
Add our getPlayer Query.
Define your getPlayer field.
Result of getting our specified player.
Define updatePlayer field
Define updatePlayer resolver field.
Result of updatePlayer resolver and type definition
Define a deletePlayer field.
Define delete resolver.
Result of deletePlayer resolver and type definition
Add a useGetForQueries property to your HttpLink instance for your Apollo Client.
Define a Player component responsible for retrieving data for now.
Add a fetchPolicy of network-and-cache to player’s list component.
Import your Player component, and define nested routes.
Alter the query to also retrieve the player’s id.
Alter your method for rendering each individual item so your can redirect to the Player component.
Define mutations to your Player component.
Add a updatePlayerFunc and deletePlayerFunc
Add useGetForQueries for using queries for only get requests.
Define your Player component for retrieving queries.
Define your styles for your UpdatePlayer.css.
Import your Player component to your Router.
Edit your .map to redirect to each item to each corresponding Player.
Result of getting specific player.
Define your mutations for update, and delete for your react app.
Define your updatePlayerFunc, and deletePlayerFunc for your Player component.
Finish off your Player component.
Update Player result.
Delete Player result.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store