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

feat: graphql support for collections #1027

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

rtpascual
Copy link
Contributor

@rtpascual rtpascual commented Jun 23, 2023

Problem

Customers who do not use DataStore are not able to create collections with GraphQL APIs.

Solution

Conditionally generate needed code for GraphQL APIs rather than using the DataStore library for collections.

Additional Notes

Links

Ticket

GitHub issue _____

Other links

Verification

Manual tests

Automated tests

  • Unit tests added/updated
  • E2E tests added/updated
  • N/A - (provide a reason)
  • deferred - (provide GitHub issue for tracking)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2023

Codecov Report

Merging #1027 (f00b633) into tagged-release/graphql-support (d285a7e) will increase coverage by 0.12%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@                        Coverage Diff                         @@
##           tagged-release/graphql-support    #1027      +/-   ##
==================================================================
+ Coverage                           93.61%   93.73%   +0.12%     
==================================================================
  Files                                 123      123              
  Lines                                5591     5699     +108     
  Branches                             1682     1713      +31     
==================================================================
+ Hits                                 5234     5342     +108     
  Misses                                337      337              
  Partials                               20       20              
Impacted Files Coverage Δ
packages/codegen-ui/lib/types/bindings.ts 100.00% <ø> (ø)
...react/lib/amplify-ui-renderers/amplify-renderer.ts 100.00% <100.00%> (ø)
...en-ui-react/lib/amplify-ui-renderers/collection.ts 98.48% <100.00%> (+0.86%) ⬆️
.../codegen-ui-react/lib/forms/react-form-renderer.ts 96.48% <100.00%> (-0.04%) ⬇️
packages/codegen-ui-react/lib/helpers/index.ts 96.55% <100.00%> (+0.25%) ⬆️
.../codegen-ui-react/lib/imports/import-collection.ts 93.69% <100.00%> (+0.05%) ⬆️
...ges/codegen-ui-react/lib/imports/import-mapping.ts 100.00% <100.00%> (ø)
...gen-ui-react/lib/react-studio-template-renderer.ts 93.29% <100.00%> (+1.27%) ⬆️
.../codegen-ui-react/lib/views/react-view-renderer.ts 80.31% <100.00%> (-0.31%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d285a7e...f00b633. Read the comment docs.

@rtpascual rtpascual marked this pull request as ready for review June 23, 2023 22:08
@rtpascual rtpascual requested a review from a team as a code owner June 23, 2023 22:08
@letsbelopez
Copy link
Contributor

Should we be adding e2e tests for this new interface?

@rtpascual
Copy link
Contributor Author

Should we be adding e2e tests for this new interface?

There is a spike to see how we will be tackling e2e tests for GraphQL since the GraphQL calls will require a client.

@rtpascual rtpascual merged commit 52ba6e7 into tagged-release/graphql-support Jun 30, 2023
@rtpascual rtpascual deleted the graphql-collection branch June 30, 2023 17:15
letsbelopez pushed a commit that referenced this pull request Jul 19, 2023
* feat: graphql support for collections

* chore: refactor collection element to helper function and update addMappedImport
awinberg-aws pushed a commit that referenced this pull request Jul 19, 2023
* feat: graphql support for collections

* chore: refactor collection element to helper function and update addMappedImport
letsbelopez added a commit that referenced this pull request Jul 19, 2023
* feat: add graphql support for components

* feat: add graphql support for create form (#1008)

* feat: add graphql support for create form with relationships (#1010)

* Update GraphQL API import and refactor GraphQL call expressions (#1012)

* chore: update graphql api import

* chore: refactor graphql call expressions to common function

* chore: use pluralize for graphql list queries

* feat: add graphql support for update form (#1015)

* feat: add graphql support for update form

* fix: update snapshot

* feat: add more assertions to check for graphql support

* fix: removing obselete snapshot

* fix: force update mutation to use id var

* chore: add declaration snapshots (#1018)

* Update from main (#1025)

* fix: parse operand value when field is number type (#1013)

Co-authored-by: Justin Shih <[email protected]>

* chore(release): v2.14.0 (#1014)

Co-authored-by: Justin Shih <[email protected]>

* fix: fix storage field prop import to storagemanager (#1016)

Co-authored-by: Justin Shih <[email protected]>

* chore(release): v2.14.1 (#1017)

Co-authored-by: Justin Shih <[email protected]>

* fix: add getOverrideProps to StorageManager (#1020)

* fix: add getOverrideProps to StorageManager

* fix: add overrideProps to Field component

* Revert "fix: add overrideProps to Field component"

This reverts commit 6393718.

* chore(release): v2.14.2 (#1022)

* fix: return theme declaration file from render func (#1023)

Co-authored-by: Doesnt Matter <[email protected]>

* fix: alias colliding imported model name in hasMany relationship (#1019)

Co-authored-by: Justin Shih <[email protected]>

* chore: update cli check

---------

Co-authored-by: Justin Shih <[email protected]>
Co-authored-by: Justin Shih <[email protected]>
Co-authored-by: Charles Shin <[email protected]>
Co-authored-by: David Lopez <[email protected]>
Co-authored-by: Doesnt Matter <[email protected]>
Co-authored-by: Roshane Pascual <[email protected]>

* feat: update GraphqlRenderConfig to use separate props for each file path

* feat: graphql support for collections (#1027)

* feat: graphql support for collections

* chore: refactor collection element to helper function and update addMappedImport

* feat: adding graphql support for update forms with relationship (#1030)

* fix: wrapping list graphql result for await (#1032)

* feat: add graphql support for relationship forms with autocomplete field

* fix: autocomplete options prop using incorrect records (#1035)

* feat: add graphql support for relationship forms with autocomplete field

* fix: autocomplete options prop using incorrect records

* feat: add helpers to identify api dependencies

* fix: use related model name instead of field in generating graphql qu… (#1039)

* fix: use related model name instead of field in generating graphql queries

* fix: updating invalid schema in integ test

* feat: exit early in integ test failure

* fix: lowering nyc coverage threshold

---------

Co-authored-by: Albert Winberg <[email protected]>
Co-authored-by: Roshane Pascual <[email protected]>
Co-authored-by: Charles Shin <[email protected]>
Co-authored-by: awinberg-aws <[email protected]>
Co-authored-by: Justin Shih <[email protected]>
Co-authored-by: Justin Shih <[email protected]>
Co-authored-by: David Lopez <[email protected]>
Co-authored-by: Roshane Pascual <[email protected]>
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.

5 participants