Open richardguerre opened 3 years ago
Hi @richardguerre i can suggest switching to a code first graphql schema. I heavily use GraphQL Schema override extension. I worked a lot on the parse-server implementation to achieve what you are searching for.
You can choose your favorite code first GraphQL Schema tool (ex: nexus).
You can find some example on one of my open source repo:
You can see on this file https://github.com/Moumouls/parse-next-mono-starter/blob/master/packages/back/src/customSchema/types/User.ts that i override the "email" field with a custom "EmailSclaer". You can use the same strategy to override your Float fields with Int fields.
btw @mtrezza this feature is supported but not correctly documented yet.
What would you suggest how to proceed with this?
I need to send a Documentation PR on this @mtrezza since it's supported and super useful
New Feature / Enhancement Checklist
Current Limitation
When trying to tighten the GraphQL type definitions by example changing a Parse number field to be
Int
instead ofFloat
in the GraphQL schema. Currently getting this error in the server logs, when trying to override a number field with typeInt
:Feature / Enhancement Description
Allow overriding of existing field types in the GraphQL schema.
Example Use Case
If I also know that all my numbers are all integers, then I can do this too:
extend input NumberWhereInput { equalTo: Int notEqualTo: Int lessThan: Int lessThanOrEqualTo: Int greaterThan: Int greaterThanOrEqualTo: Int in: [Int] notIn: [Int] }