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

Fix excludePNP parsing for GraphQL #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

laggycomputer
Copy link
Member

Description

As specified in the issue, excludePNP is broken for GraphQL grades endpoints. Zod expects a string, which is impossible when schema expects boolean. Fixed by coercing to string before parsing.

z.coerce.boolean() is unacceptable since Boolean("false") === true which is not what we want.

Related Issue

Fixes #62.

Motivation and Context

i just wanna use API man

How Has This Been Tested?

Tested with Postman on a local deployment.

Screenshots (if appropriate):

Screenshot_20241223_113903

Schema validation still works, of course:
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code involves a change to the database schema.
  • My code requires a change to the documentation.

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

Successfully merging this pull request may close these issues.

Grade aggregation: excludePNP breaks query
1 participant