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

Inversion of skip? #32

Open
acro5piano opened this issue Jun 17, 2021 · 1 comment
Open

Inversion of skip? #32

acro5piano opened this issue Jun 17, 2021 · 1 comment

Comments

@acro5piano
Copy link

acro5piano commented Jun 17, 2021

Hi, thank you for the great library again.

I would like to propose a new API only, which is the inversion of skip.

The use case: We have a database table and GraphQL schema has "virtual" columns.

GraphQL:

type User {
  id: ID!
  firstName: String
  lastName: String
  fullName: String
}

Database:

- users:
  - id
  - firstName
  - lastName

Resolver:

const UserResolver = {
  lastName(root: User) {
    return `${user.firstName} ${user.lastName}`
  }
}

In this case, it would be really helpful if we have only

fieldsToList(info, {
  only: ['id', 'firstName', 'lastName'],
})

If you are okay, I'll create a PR for this.

Thanks

@Mikhus
Copy link
Owner

Mikhus commented Nov 9, 2024

Sounds great, I was missing this project for a while, so if it is still n open proposal - P>R is welcomed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants