Skip to content

Handling ObjectId in filter #57

@sscots

Description

@sscots

Say I want to get a specific person record and filter by _id

person (
   filter: {
       _id: { EQ: "5e1e2d653a32a05f51f621c1" }
   }
) {
   name { 
      lastName
   }
   age
}

Currently that will generate a filter like so

{ _id: { '$eq': '5e1e2d653a32a05f51f621c1' }

Can you detect when "_id" is used and make it essentially do this instead?

{ _id: { '$eq': new ObjectId('5e1e2d653a32a05f51f621c1') }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions