vazco / uniforms

A React library for building forms from any schema.
https://uniforms.tools
MIT License
1.93k stars 239 forks source link

custom scalar type support in graphqlschemabridge #1309

Closed nyagna219 closed 4 months ago

nyagna219 commented 4 months ago

I am using uniforms to build forms base on graphql schema and facing issues with custom scalar types. I looked at this issue - https://github.com/vazco/uniforms/issues/732 and while the suggestion in the comments works for this use case(i.e. custom scalar is used at the main type - Request level that is that parameter for .getType()), it does not work when the scalar is used int a type - B which is part of type - Request. i.e. const schema = ` scalar DateTime type Address { a: Float b: String! titleA: String! d: String! title: String! dates: [date]! }

type date { dateTime: DateTime }

type Query { anything: ID } `; can you tell me how "extras" would look like for this use case?

nyagna219 commented 4 months ago

please ignore the above issue. It can be addressed with the help of AutoField.componentDetectorContext.Provider - https://uniforms.tools/docs/uth-autofield-algorithm/ . This way hierarchy in types won't cause an issue

nyagna219 commented 4 months ago

please see previous comment