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

Can't query by id? #14

Closed
bwalsh opened this issue Mar 7, 2018 · 3 comments
Closed

Can't query by id? #14

bwalsh opened this issue Mar 7, 2018 · 3 comments
Assignees
Labels

Comments

@bwalsh
Copy link

bwalsh commented Mar 7, 2018

Thanks for a great library.

After starting examples/flask_mongoengine :
I expected I would be able to query by id?
I'm unable to query by id, but can query by name

{
  allEmployees(id:"RW1wbG95ZWU6NWE5ZjE4NzA2MGJmZmVhZDcyYmI3Zjgw") {
    pageInfo {
      hasNextPage
    }
    edges {
      node {
        id, name        
        department {
          id, name
        }
      }
    }
  }
}


{
  "errors": [
    {
      "message": "u'RW1wbG95ZWU6NWE5ZjE4NzA2MGJmZmVhZDcyYmI3Zjgw' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string",
      "locations": [
        {
          "column": 3,
          "line": 13
        }
      ]
    }
  ],
  "data": {
    "allEmployees": null
  }
}

{
  allEmployees( name: "Peter") {
    pageInfo {
      hasNextPage
    }
    edges {
      node {
        id, name        
        department {
          id, name
        }
      }
    }
  }
}

{
  "data": {
    "allEmployees": {
      "pageInfo": {
        "hasNextPage": false
      },
      "edges": [
        {
          "node": {
            "id": "RW1wbG95ZWU6NWE5ZjE4NzA2MGJmZmVhZDcyYmI3Zjgw",
            "name": "Peter",
            "department": {
              "id": "RGVwYXJ0bWVudDo1YTlmMTg3MDYwYmZmZWFkNzJiYjdmN2M=",
              "name": "Engineering"
            }
          }
        }
      ]
    }
  }
}
@abawchen abawchen self-assigned this Mar 7, 2018
@abawchen
Copy link
Collaborator

abawchen commented Mar 7, 2018

@bwalsh: Thanks for addressing this issue!

I am working on it and will get you back if any progress.

@abawchen
Copy link
Collaborator

abawchen commented Mar 8, 2018

@bwalsh
Now you can filter by global id with v0.1.7 or master branch.
I close this first, if any problem I will re-open it.

@abawchen abawchen closed this as completed Mar 8, 2018
@bwalsh
Copy link
Author

bwalsh commented Mar 9, 2018

@abawchen 👍 works great

abhinand-c referenced this issue in strollby/graphene-mongo Jun 12, 2023
abhinand-c referenced this issue in strollby/graphene-mongo Jun 12, 2023
Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
Co-authored-by: Arun Suresh Kumar <arun@strollby.com>
Co-authored-by: Adarsh Divakaran <adarshdevamritham@gmail.com>
Co-authored-by: Arun Suresh Kumar <89654966+arun-sureshkumar@users.noreply.github.com>
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

2 participants