1

As you have read in the title I am trying to add data through graphql (mutations) with this plugin. This is my code:

mutation{
  allMoltinProduct (id:"d348fcc5-3e1c-5ebb-a1bb-9a4716bb56af",name:"Camiseta",formatted:"7.49"){
    edges {
      node {
        id
        name
        description
        meta {
          display_price {
            with_tax {
              amount
              currency
              formatted
            }
          }
        }
        mainImageHref
        mainImage {
          childImageSharp {
            sizes(maxWidth: 400) {
              ...GatsbyImageSharpSizes
            }
          }
        }
        slug
        material
        max_watt
        bulb_qty
        bulb
        sku
        finish
      }
    }
  }
}

And It gives me the following error.


{
  "errors": [
    {
      "message": "Schema is not configured for mutations.",
      "locations": [
        {
          "line": 1,
          "column": 1
        }
      ],
      "stack": [
        "GraphQLError: Schema is not configured for mutations.",
        "    at getOperationRootType (D:\\gatsby-store\\node_modules\\graphql\\utilities\\getOperationRootType.js:28:13)",
        "    at executeOperation (D:\\gatsby-store\\node_modules\\graphql\\execution\\execute.js:210:61)",
        "    at executeImpl (D:\\gatsby-store\\node_modules\\graphql\\execution\\execute.js:104:14)",
        "    at execute (D:\\gatsby-store\\node_modules\\graphql\\execution\\execute.js:64:35)",
        "    at D:\\gatsby-store\\node_modules\\express-graphql\\index.js:152:16",
        "    at runMicrotasks (<anonymous>)",
        "    at processTicksAndRejections (internal/process/task_queues.js:95:5)"
      ]
    }
  ],
  "extensions": {}
}

This is one of the products that is already in graphql on which I am basing myself to add my own:

{
  "data": {
    "allMoltinProduct": {
      "edges": [
        {
          "node": {
            "id": "1981f542-8a23-460c-83b5-008130ced9a6",
            "name": "Crown",
            "description": "",
            "meta": {
              "display_price": {
                "with_tax": {
                  "amount": 37500,
                  "currency": "USD",
                  "formatted": "$375.00"
                }
              }
            },
            "mainImageHref": "",
            "mainImage": {
              "childImageSharp": {
                "sizes": {
                  "base64": "",
                  "aspectRatio": 1,
                  "src": "/static/7cf7d1a319dc9018fe0704ddff047bd4/497c6/14be2d71-b84a-494a-924f-a78ed2bfcb1e.png",
                  "srcSet": "",
                  "sizes": "(max-width: 400px) 100vw, 400px"
                }
              }
            },
            "slug": "crown",
            "material": "Steel",
            "max_watt": "5W",
            "bulb_qty": "12",
            "bulb": "GU10",
            "sku": "CWLP100BLK",
            "finish": "Matt Black"
          }
        }
      ]
    }
  },
  "extensions": {}
}

Is it possible that only queries can be made to show data but not modify or add new data with this plugin? And if possible, how do I implement it and where? A greeting and thanks for your time.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
L3G3ND
  • 32
  • 4

0 Answers0