amplify-cli
amplify-cli copied to clipboard
Add custom port support for GraphQL mock
Description of changes
- Import custom port named
graphqlPortfromamplify/mock.json, and add capability to run GraphQL mock on the given port.
mock.json
portfor DynamoDB LocalgraphqlPortfor AppSync Simulator
{
"port": 8000
"graphqlPort": 8001
}
Issue #, if available
https://github.com/aws-amplify/amplify-category-api/issues/384
Description of how you validated changes
- add
graphqlPortintoamplify/mock.jsonlike below
{
"graphqlPort": 8001
}
- graphql mock server successfully ran on the given port
- also checked mock server running on port 20002 without
mock.json
Checklist
- [x] PR description included
- [x]
yarn testpasses - [x] Tests are changed or added
- [ ] Relevant documentation is changed or added (and PR referenced)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Codecov Report
Merging #10978 (4a8305d) into dev (fb2ba7b) will increase coverage by
0.41%. The diff coverage is100.00%.
@@ Coverage Diff @@
## dev #10978 +/- ##
==========================================
+ Coverage 47.81% 48.22% +0.41%
==========================================
Files 669 669
Lines 32671 32673 +2
Branches 6600 6600
==========================================
+ Hits 15621 15757 +136
+ Misses 15420 15288 -132
+ Partials 1630 1628 -2
| Impacted Files | Coverage Δ | |
|---|---|---|
| packages/amplify-util-mock/src/api/index.ts | 81.81% <100.00%> (+81.81%) |
:arrow_up: |
| ...es/amplify-util-mock/src/api/resolver-overrides.ts | 2.91% <0.00%> (+2.91%) |
:arrow_up: |
| ...-mock/src/CFNParser/resource-processors/appsync.ts | 8.51% <0.00%> (+8.51%) |
:arrow_up: |
| ...ges/amplify-util-mock/src/CFNParser/stack/index.ts | 11.03% <0.00%> (+11.03%) |
:arrow_up: |
| ...l-mock/src/CFNParser/appsync-resource-processor.ts | 11.11% <0.00%> (+11.11%) |
:arrow_up: |
| ...ges/amplify-util-mock/src/utils/dynamo-db/index.ts | 11.53% <0.00%> (+11.53%) |
:arrow_up: |
| ...ges/amplify-util-mock/src/utils/dynamo-db/utils.ts | 11.90% <0.00%> (+11.90%) |
:arrow_up: |
| ...s/amplify-util-mock/src/utils/dynamo-db/helpers.ts | 12.50% <0.00%> (+12.50%) |
:arrow_up: |
| ...li/src/domain/amplify-usageData/getUsageDataUrl.ts | 100.00% <0.00%> (+12.50%) |
:arrow_up: |
| packages/amplify-util-mock/src/api/api.ts | 12.72% <0.00%> (+12.72%) |
:arrow_up: |
| ... and 12 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hey @kopkunka55, would you be interested in continuing to work on this PR? If so, please rebase this onto dev by running git rebase dev. We will help you with getting this PR to the finish line 🏁
rebased
Hi @kopkunka55 this change looks good to me but it needs a corresponding docs update. Would you be willing to put up a PR documenting this config value here: https://github.com/aws-amplify/docs/blob/f7e87744f26badf5488cbfee4162269582ddf634/src/pages/cli/usage/mock.mdx