Prisma1: graphcool reset does not work for local targets

Created on 27 Nov 2017  Â·  3Comments  Â·  Source: prisma/prisma1

Current behavior

graphcool reset --target local results in

ERROR: Cannot query field 'resetProjectData' on type 'Mutation'. (line 2, column 11):
          resetProjectData(input: {
          ^

{
  "data": null,
  "errors": [
    {
      "message": "Cannot query field 'resetProjectData' on type 'Mutation'. (line 2, column 11):\n          resetProjectData(input: {\n          ^",
      "locations": [
        {
          "line": 2,
          "column": 11
        }
      ]
    }
  ],
  "status": 400
}

Get in touch if you need help: https://www.graph.cool/forum
To get more detailed output, run $ set -x DEBUG "*"

Reproduction

graphcool init
graphcool deploy --target local # choose local
graphcool reset --target local

Expected behavior?

Resets the data of the local service.

Most helpful comment

Currently, the quickest way to reset all data locally is to

  • comment out all lines in types.graphql
  • force deploy, make sure to specify the local target! example: graphcool deploy --force --target local
  • revert commenting changes to types.graphql
  • deploy again, graphcool deploy --target local

All 3 comments

Currently, the quickest way to reset all data locally is to

  • comment out all lines in types.graphql
  • force deploy, make sure to specify the local target! example: graphcool deploy --force --target local
  • revert commenting changes to types.graphql
  • deploy again, graphcool deploy --target local

Now that we have import and export with the newest CLI, this would be really helpful to have working locally for staging clean sample data in a dev/testing environment.

For future googlers trying to reset their local graphcool data, but getting an error such as:

There are issues with the new service definition:

  Global
    ✖ Did not find the type or relation you provided a permission for: 'User.read, ...'

In addition to the above steps, you also need to comment out the contents of graphcool.yml, but leave the types: ./types.graphql line:

types: ./types.graphql

#permissions:
#- operation: User.read
#- operation: User.create
#- operation: User.update
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fi1osof picture Fi1osof  Â·  3Comments

jannone picture jannone  Â·  3Comments

notrab picture notrab  Â·  3Comments

tbrannam picture tbrannam  Â·  3Comments

hoodsy picture hoodsy  Â·  3Comments