frankcollins3 / PHPokedex

react concepts
0 stars 0 forks source link

graphiql? [5:27am] #19

Closed frankcollins3 closed 1 year ago

frankcollins3 commented 1 year ago

was working in another repo and was able to see the API schema defined by graphQL properties.

frankcollins3 commented 1 year ago

👍 localhost:5000/graphql 👎 localhost:3000/graphql

run it from the location of the graphQL schema, in this instance graphQL is within: /server: index.js

[5:33am]

frankcollins3 commented 1 year ago

the error tells you it expected the name but found {

    addPokemon: {
        type: PokemonType,
        description: 'Add a pokemon',
        args: {
            // arg to run condition against. With a strict equality match
         * * *   name: { type: new GraphQLNonNull(GraphQLString) }   * * *
        },
        resolve: (parent, args) => {
            const newpokemon = { name: args.name }
            pokemon.push(newpokemon)
            return pokemon;
        }
    }

Screen Shot 2023-05-08 at 9 10 55 AM

[9:12am]

frankcollins3 commented 1 year ago

no ' ' have to use " " double quotes in graphQL

Screen Shot 2023-05-08 at 9 13 39 AM

[9:14am]