Root Field
This example shows how to use dedicated root field methods to easily operate on one GraphQL root field at at time. If you need to work with multiple root fields, check out the batch
example.
ts
import { Graffle } from './graffle/__.js'
const pokemon = Graffle.create()
const pokemons = await pokemon.query.pokemons({ name: true })
console.log(pokemons)
Outputs
json
[
{
"name": "Pikachu"
},
{
"name": "Charizard"
},
{
"name": "Squirtle"
},
{
"name": "Bulbasaur"
},
{
"name": "Caterpie"
},
{
"name": "Weedle"
}
]