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

CIF-1654 - CIF React Core Components should support GraphQL GET requests #426

Merged
merged 18 commits into from
Nov 2, 2020

Conversation

herzog31
Copy link
Member

@herzog31 herzog31 commented Oct 21, 2020

Description

  • Added dependency to GraphQL client 1.7.0 which exports the complete GraphQL client configuration.
    • Also updated MagentoGraphqlClient to expose the client configuration.
  • StoreConfigExporterImpl now read the GraphQL client configuration to export the configured HTTP method for GraphQL requests.
    • Update page component HTL to expose the HTTP method in the body tag.
    • Also added an IT for this.
  • Added graphqlMethod as new attribute to ConfigContext (also see Venia PR).
  • Updated ApolloClient to respect the configured HTTP method.
    • Implemented query compression in the compressQueryFetch method. This is required because of limits of the Magento Cloud CDN. Otherwise for example the getCartDetails query exceeds the allowed URL length and is blocked.
  • Updated unit tests.

The integration test setup, that uses the CIF add-on will fail until a new add-on release which includes GraphQL client 1.7.0

Also see adobe/aem-cif-guides-venia#80.

How Has This Been Tested?

  • Tested with Venia
  • Unit and ITs

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:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@herzog31 herzog31 marked this pull request as ready for review October 21, 2020 15:04
Base automatically changed from issues/CIF-1633 to master October 28, 2020 08:18
@codecov
Copy link

codecov bot commented Nov 2, 2020

Codecov Report

Merging #426 into master will increase coverage by 0.04%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #426      +/-   ##
============================================
+ Coverage     85.18%   85.23%   +0.04%     
- Complexity     1058     1061       +3     
============================================
  Files           219      220       +1     
  Lines          5421     5445      +24     
  Branches        780      785       +5     
============================================
+ Hits           4618     4641      +23     
- Misses          651      652       +1     
  Partials        152      152              
Flag Coverage Δ Complexity Δ
integration 67.17% <85.71%> (+0.04%) 768.00 <2.00> (+2.00)
jest 79.85% <88.23%> (+0.11%) 0.00 <0.00> (ø)
karma 93.65% <100.00%> (+0.01%) 0.00 <0.00> (ø)
unittests 85.82% <100.00%> (+0.03%) 1022.00 <2.00> (+3.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
react-components/src/components/App/app.js 20.00% <0.00%> (ø) 0.00 <0.00> (ø)
react-components/src/context/ConfigContext.js 100.00% <ø> (ø) 0.00 <0.00> (ø)
react-components/src/utils/compressQueryFetch.js 93.75% <93.75%> (ø) 0.00 <0.00> (?)
...e/core/components/client/MagentoGraphqlClient.java 71.01% <100.00%> (+0.42%) 13.00 <1.00> (+1.00)
...1/storeconfigexporter/StoreConfigExporterImpl.java 100.00% <100.00%> (ø) 7.00 <1.00> (+2.00)
...ore/cif/clientlibs/common/js/CommerceGraphqlApi.js 82.97% <100.00%> (+0.37%) 0.00 <0.00> (ø)

Continue to review full report at Codecov.

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

@laurentiumagureanu laurentiumagureanu merged commit 647b380 into master Nov 2, 2020
@laurentiumagureanu laurentiumagureanu deleted the issue/CIF-1654 branch November 2, 2020 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request verified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants