-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat (api): support to custom types #12750
Conversation
@svidgen @iartemiev I hope you can help me with it. Edit: as far i can see, this PR is fully working and ready to merge. I just don't mark it as 'ready for review' because I don't know if makes sense to merge it without TS is fully functional. |
@erickriva thanks for opening another PR! In the meantime we'll work on adding Custom Type support to the custom selection set types. We'll release a new version of that package once that's ready. Most of the team is out on vacation right now, so realistically we should be able to get it out towards the end of next week. I'll let leave a comment here as soon as the new version of the types package has been published. |
@erickriva btw the type issues appears to be limited to nullable custom type fields specifically. E.g. if you were to change your field definition to We'll work on supporting nullable custom type fields with custom selection set. |
@erickriva we just published an updated version of This version includes the correct paths for custom types on nullable fields in the generated custom selection set type, e.g. To get access to these changes please update the 2 "devDependencies": {
"@aws-amplify/data-schema": "^0.12.13", and "dependencies": {
"@aws-amplify/data-schema-types": "^0.6.11", |
@iartemiev Thanks for the answer. Sadly, I have no access to my computer at the moment to test this update, but as soon as I get access I'll be checking if it works well. |
@iartemiev Nice! It's working good. Setting it as |
@iartemiev I may have found a blocker. Checking AppSync for schema, props related to custom types are not generated in GraphQL types Don't know if this is a bug or a feature not implemented yet. Can you clarify it? |
@erickriva I'm sorry, I missed your updates on this PR. I'll get it reviewed ASAP. Could you please resolve the conflicts when you get a chance? |
I believe this is expected behavior at the moment. What are the use cases you have in mind that are blocked by this? |
Think of an app which has a 'diary' annotation, which multiple people can edit simultaneously. What if 'Person A' adds an annotation for any day of past week? Bandwidth and re-renders could be cut, improving user experience without much work (good for a simple app). |
@erickriva couldn't you just use a model field for that value, which is already filterable? What's the benefit specifically for custom types? |
Could you please bump the size limit here to |
Surely not the best example 🤔. I have created off the top of my head, trying to explain it. Maybe missing some details. |
@erickriva - thank you so much for contributing to Amplify again! These changes have now been published to the latest |
@erickriva 🙏 thank for your fix as it solves a problem on which i spent several hours today (inconsistent returns from |
Description of changes
Added support for custom types in GraphQL API.
Issue #, if available
Refer to aws-amplify/amplify-category-api#2096, but I managed to work modifying this lib.
Description of how you validated changes
Installing locally in a real app project.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.