Graphql “Unknown argument “bookId” on field “book” of type “Explore”.”

Graphql “Unknown argument “bookId” on field “book” of type “Explore”.”


0

I’m trying to call my API but it keeps giving me 400 Error request with the error of:

message: "Unknown argument "bookId" on field "book" of type "Explore"."

I’ve just read the documentation of Apollo graphql and tried to fetch my data the way it said with variables and args, and it’s in my store:

 async fetchBookContent({ commit }, data) {
const variables = ref({
  bookId: data.bookId,
})
const ALL_BOOKS_QUERIES = gql`
  query LoadBookQInputModel($bookId: String!) {
    book(bookId: $bookId) {
      information {
        name
      }
    }
  }
`
const { result } = useQuery(ALL_BOOKS_QUERIES, variables)
console.log(result)
commit('content', result)

},

It keeps giving me 400 :'(

The Payload

The Preview of Error


Load 7 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *