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 :'(