aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

add support for deleting mock data with a command, without restarting mock server #261

Open anisg opened 4 years ago

anisg commented 4 years ago

Is your feature request related to a problem? Please describe. Small issue: when I need to reset the mock data via command line (rm ./amplify/mock-data/dynamodb/fake_us-fake-1.db) I then need to manually restart the mock API server, which is a bit boring.

Describe the solution you'd like add to the mock API a route '/resetFakeData' (or anything else) which will remove the fake data without having to restart the server.

ammarkarachi commented 4 years ago

@anisg would you rather have a command that resets the mock Api server?

anisg commented 4 years ago

@ammarkarachi yes that would work too.

anisg commented 4 years ago

another thing that would make sense too is to add a button "Reset Data" in the GraphiQL Explorer.

xitanggg commented 4 years ago

In the user's perspective, the most intuitive way is to simply tab on a Reset button in GraphiQL.

A Reset Table button that resets/recreates the DynamoDB table might be more helpful than a Reset Data button. I run into a problem with simply resetting the data after changing the content field type from String to Int and it keeps throwing ValidationException error until I reset the table.

 type Object @model {
    id: ID!
    content: String!  #Throws ValidationException errors if changes to Int! after table has been created
}
xitanggg commented 4 years ago

It would also be helpful to move the ADD NEW row to the top left instead of being at bottom left on the Explorer panel. Considered all the buttons are at top, it is a bit counterproductive to ADD NEW row at the bottom and click run on top. It is a simple fix in code, which is just swapping the two divs block and a line of CSS to fix the border. GraphiQL

flozender commented 2 years ago

Hi, could I pick this up?