Great article!
However, I have an issue with ‘Add new book action’, after I fill out all fields and press the button, I receive the following error:
err: Error: GraphQL error: Variable ‘$title’ of type ‘String’ used in position expecting type ‘String!’. (line 1, column 21):
mutation createBook($title: String, $author: String, $description: String, $rating: Int, $image: String) {
^
(line 2, column 21):
createBook(title: $title, author: $author, description: $description, rating: $rating, image: $image) {
^
GraphQL error: Variable ‘$author’ of type ‘String’ used in position expecting type ‘String!’. (line 1, column 37):
mutation createBook($title: String, $author: String, $description: String, $rating: Int, $image: String) {
^
(line 2, column 37):
createBook(title: $title, author: $author, description: $description, rating: $rating, image: $image) {
^
GraphQL error: Variable ‘$description’ of type ‘String’ used in position expecting type ‘String!’. (line 1, column 54):
mutation createBook($title: String, $author: String, $description: String, $rating: Int, $image: String) {
^
(line 2, column 59):
createBook(title: $title, author: $author, description: $description, rating: $rating, image: $image) {
^
GraphQL error: Variable ‘$rating’ of type ‘Int’ used in position expecting type ‘Int!’. (line 1, column 76):
mutation createBook($title: String, $author: String, $description: String, $rating: Int, $image: String) {
^
(line 2, column 81):
createBook(title: $title, author: $author, description: $description, rating: $rating, image: $image) {
^
GraphQL error: Variable ‘$image’ of type ‘String’ used in position expecting type ‘String!’. (line 1, column 90):
mutation createBook($title: String, $author: String, $description: String, $rating: Int, $image: String) {
^
(line 2, column 97):
createBook(title: $title, author: $author, description: $description, rating: $rating, image: $image) {
^
at new ApolloError (apollo.umd.js:1973)
at apollo.umd.js:2887
at tryCallOne (core.js:37)
at core.js:123
at JSTimers.js:117
at Object.callTimer (JSTimersExecution.js:95)
at Object.callImmediatesPass (JSTimersExecution.js:199)
at Object.callImmediates (JSTimersExecution.js:214)
at MessageQueue.js:228
at MessageQueue.__guard (MessageQueue.js:218)
What can be cause of this?
Thanks!