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

Filters to take into account simple field aliases #23

Open
IlyaSemenov opened this issue Jul 12, 2023 · 1 comment
Open

Filters to take into account simple field aliases #23

IlyaSemenov opened this issue Jul 12, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@IlyaSemenov
Copy link
Owner

Resolver:

export const Org = r.table(db.org, {
	fields: {
		id: true,
		name: true,
		operator_id: 'operatorId', // graphql field differs from db table field
	},
})

Query:

query orgs($operator_id: ID) {
	orgs(filter: { operator_id: $operator_id }) {
		id
		name
	}
}

Expected: filter works.

Actual result: column "operator_id" does not exist

@IlyaSemenov IlyaSemenov added the enhancement New feature or request label Jul 12, 2023
@IlyaSemenov
Copy link
Owner Author

This will inconsistent with r.field({ field: 'operatorId' }) though.

@IlyaSemenov IlyaSemenov added the help wanted Extra attention is needed label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant