Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete query from collection not working #824

Closed
jkporter opened this issue Jun 15, 2019 · 5 comments
Closed

Delete query from collection not working #824

jkporter opened this issue Jun 15, 2019 · 5 comments
Labels
Milestone

Comments

@jkporter
Copy link

Describe the bug
Attempting to deleted a query reports success but doesn't appear to actually do anything as query remains.

Expected behavior
I have two queries with the same name in the same collection but different queries and I'd like to delete one of them.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: WIndows 10 1903
  • Browser N/A
  • Version 2.2.0
@welcome
Copy link

welcome bot commented Jun 15, 2019

👋🏾Thanks for opening your first issue here! Be sure to follow the issue template! ✌🏾

@imolorhe imolorhe added the bug label Jun 15, 2019
@imolorhe
Copy link
Collaborator

Thanks for reporting this! I'd look into it as soon as I can.

@alexisdray
Copy link

Just ran into the same issue:
This query won't save changes or be deleted (although UI reports success in both cases)
I've included the export of the collection in case that's helpful.

It's hard to be sure, but I believe I also had two queries originally named the same thing.

The problematic query is the first one from the collection 'createItem'
Seems to me like it's missing the 'id' property.

{
"version": 1,
"type": "collection",
"title": "comments",
"queries": [
{
"version": 1,
"type": "window",
"query": "mutation createItem($ItemInput: CreateItemInput) {\n createItem(input: $ItemInput) {\n id\n name\n description\n createdBy {\n id\n }\n starred\n deal {\n id\n }\n status\n createdDate\n modifiedDate\n }\n}\n",
"apiUrl": "http://localhost:3000/graphql",
"variables": "{}",
"subscriptionUrl": "",
"headers": [
{
"key": "",
"value": ""
}
],
"windowName": "createComment"
},
{
"version": 1,
"type": "window",
"query": "mutation updateComment($CommentInput: CreateCommentInput) {\n createComment(input: $CommentInput) {\n id\n body\n }\n}\n",
"apiUrl": "http://localhost:3000/graphql",
"variables": "{\n "CommentInput": {\n\t"body": "item description test",\n "item": 8\n }\n}",
"subscriptionUrl": "",
"headers": [
{
"key": "authorization",
"value": "bearer {{bearer}}"
}
],
"windowName": "updateComment",
"id": "6c1e5bda-3119-43d6-8a66-84291842d93e",
"created_at": 1560551539195,
"updated_at": 1560551539195
},
{
"version": 1,
"type": "window",
"query": "query{\n getCommentById(id: 9){\n id\n\t\tbody\n createdBy{\n id\n username\n }\n item{\n id\n comments{\n id\n }\n }\n }\n}",
"apiUrl": "http://localhost:3000/graphql",
"variables": "{}",
"subscriptionUrl": "",
"headers": [
{
"key": "authorization",
"value": "bearer {{bearer}}"
}
],
"windowName": "getCommentById",
"id": "02149edc-2d3b-4bad-be38-855e9034baed",
"updated_at": 1560636115200
}
],
"created_at": 1560309014178,
"updated_at": 1560636403474,
"id": 6
}

@imolorhe
Copy link
Collaborator

Is it fair to assume that the problematic queries were created when the collections feature was originally introduced?

As @alexisdray pointed out, queries in collections originally didn't have IDs before the delete functionality was created, and there was a fallback using the query name to identify the query, which was removed much later after the collections feature was developed, with the assumption that there wouldn't be a lot of queries created with the wrong query.

3fab083#diff-e668c653afe97933b80714010e8256b4R40

As a. fix, I would re-introduce the fallback with the query name.

@imolorhe
Copy link
Collaborator

It probably also makes sense to add an indicator for deprecated queries, so the developers can know to recreate them.

@imolorhe imolorhe added this to the v2.2.1 milestone Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants