graphql-kit / graphql-lodash

🛠 Data manipulation for GraphQL queries with lodash syntax
https://apis.guru/graphql-lodash/
MIT License
1.23k stars 48 forks source link

@_(get: "x") will remove all properties on the current object #45

Closed SubZane closed 3 years ago

SubZane commented 3 years ago

The example below will remove id and title from the post object. Is this as intended?

query getPost {
  post(id: 1) @_(get:"user") {
    id
    title
    user {
      id
      name
      username
      email
    }
  }
}
IvanGoncharov commented 3 years ago

@SubZane Yes, exactly. You should get content of user under the top-level post field.

SubZane commented 3 years ago

ok thanks for the reply, to bad I was hoping that the fields would merge instead of just replacing the whole post object with the user.

But I understand that would be much more problematic to do :)