-
Notifications
You must be signed in to change notification settings - Fork 685
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
[PWA-1658] Move graphql-cli-validate-magento-pwa-queries to @magento scope #3198
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fa7a5b0
Some preliminary work to get introspection working in v4
tjwiebell f8a6f42
Get new cli validation passing following the current eslint rules
tjwiebell 063b1bc
Minor cleanup
tjwiebell f005420
Remove package from workspaces so it doesn't pollute node_modules wit…
tjwiebell 2b15e9a
Restore additional graphql validation through linting rules
tjwiebell 99068e6
- Re-add package dependencies that were being hidden by hoisting
tjwiebell 74243f0
Test adding additional files to copy command
tjwiebell 4252a9a
Back out change that didn't work
tjwiebell 5f025c7
Merge branch 'develop' into tommy/rename-validator
dpatil-magento b9de346
Address PR feedback and resolve validation errors with name collisions.
tjwiebell 0f56922
Fix missed @client directive
tjwiebell 52ed88d
Remove codegen section until we can resolve name conflicts
tjwiebell f94d9dc
Colocate client schemas with components
tjwiebell 5b7fd9c
Merge branch 'develop' into tommy/rename-validator
dpatil-magento File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const path = require('path'); | ||
require('dotenv').config({ | ||
path: path.resolve(process.cwd(), 'packages/venia-concept/.env') | ||
}); | ||
|
||
const excludePatterns = | ||
process.env.MAGENTO_BACKEND_EDITION === 'EE' | ||
? ['!**/*.ce.js'] | ||
: ['!**/*.ee.js']; | ||
|
||
const config = { | ||
schema: [ | ||
`${process.env.MAGENTO_BACKEND_URL}/graphql`, | ||
'**/client-schema.graphql' | ||
], | ||
documents: [ | ||
'./packages/{peregrine,venia-ui,venia-concept}/{lib,src}/**/*.{js,graphql,gql}', | ||
...excludePatterns | ||
] | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/extensions/venia-sample-payments-checkmo/client-schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extend type StoreConfig { | ||
payment_checkmo_payable_to: String | ||
payment_checkmo_mailing_address: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Apollo specific directives used in the project | ||
directive @client on FIELD | ||
directive @connection(key: String) on FIELD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/peregrine/lib/talons/CartPage/GiftOptions/client-schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Mocked client fields used for gift receipt and message components | ||
# TODO: As of 2.4.2 these fields now exist, we should remove these and update components. | ||
extend type Cart { | ||
include_gift_receipt: Boolean! | ||
include_printed_card: Boolean! | ||
local_gift_message: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/peregrine/lib/talons/CartPage/ProductListing/wishlistFragment.ce.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { gql } from '@apollo/client'; | ||
|
||
export const WishlistFragment = gql` | ||
fragment WishlistFragment on Wishlist { | ||
export const WishlistNameFragment = gql` | ||
fragment WishlistNameFragment on Wishlist { | ||
id | ||
} | ||
`; |
4 changes: 2 additions & 2 deletions
4
packages/peregrine/lib/talons/CartPage/ProductListing/wishlistFragment.ee.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/peregrine/lib/talons/CheckoutPage/BillingAddress/client-schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Additional client field to persist same billing preference | ||
extend type Cart { | ||
isBillingAddressSame: Boolean! | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/peregrine/lib/talons/CheckoutPage/PaymentInformation/client-schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Additional client field needed for storing payment nonce returned by processors | ||
extend type Cart { | ||
paymentNonce: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Additional client field for storing selected currency | ||
extend type Currency { | ||
current_currency_code: String! | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only added a small subset of rules here from
packages/graphql-cli-validate-magento-pwa-queries/lib/index.js
. When I added all the validation rules listed in that file, the linter blew up with errors, so I suspect those validation rules weren't working as expected. Trying to keep this scope minimal to just feature parity with what we had before, which I why I selected this subset of rules that were working.