Unable to see my schema using amplify mock #1866
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
mock
theme:mock
transferred
How did you install the Amplify CLI?
curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd
If applicable, what version of Node.js are you using?
18.16.0
Amplify CLI Version
12.4.0
What operating system are you using?
windows 10
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
Summary:
When using the amplify mock api command, I am unable to view my schema and documentation for a project that utilizes IAM (Identity and Access Management) or User Pool as the authentication method. After extensive testing, I have observed that a brand-new project without IAM or User Pool authentication works as expected. This issue appears to be specific to projects using these authentication methods.
Steps to Reproduce:
Create a new Amplify project.
Configure authentication using IAM or User Pool.
Define an API with a GraphQL schema.
Run amplify mock api.
Attempt to access the GraphQL schema and documentation.
Expected Behavior:
I should be able to access and view the GraphQL schema and documentation when running amplify mock api, regardless of the authentication method used.
Actual Behaviour:
When IAM or User Pool authentication is enabled in the project, running amplify mock api results in an inability to access the GraphQL schema. This issue does not occur in projects without IAM or User Pool authentication, it works when I use API key.
I should be able to change the authentication method in the UI as well. It appears that currently, we are limited to using only the API key.
![image](https://private-user-images.githubusercontent.com/11049349/268401895-d17a74b3-f764-42e4-8695-a57ae6e3b3cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzM2NzcsIm5iZiI6MTczOTU3MzM3NywicGF0aCI6Ii8xMTA0OTM0OS8yNjg0MDE4OTUtZDE3YTc0YjMtZjc2NC00MmU0LTg2OTUtYTU3YWU2ZTNiM2NkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIyNDkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThlNzliMTdmZTlkZjNhYzlmMDk3OGM4MGFlMDJhOTQ1NzM4Y2I0YjM4M2E2MmU3MTZjNTg2MjQ5ZmU3MTBmNTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.U6IteY01CGljegEkChWvfCoM-FvlX5xNrVKNKZHf_6M)
![image](https://private-user-images.githubusercontent.com/11049349/268402534-e9381b0a-f783-498f-9e22-63b17a448df8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzM2NzcsIm5iZiI6MTczOTU3MzM3NywicGF0aCI6Ii8xMTA0OTM0OS8yNjg0MDI1MzQtZTkzODFiMGEtZjc4My00OThmLTllMjItNjNiMTdhNDQ4ZGY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIyNDkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMxNTc5ZWQ3NzMwYWM0MTE4YmFmZDhkNTM2N2Q0NTRkOGMzOTg3MTUxNTAwOGU4MmEzYmQ2OWE3ODhkNDNkODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dyJmOi9dUU3OCP-6ITco4igjKas51uqsM2U0zV8rQEA)
Additional Information:
Thank you for your attention to this matter, and I appreciate any assistance or insights you can offer to resolve this issue. Not being able to mock different authorization rules slows down the development process, as I am required to push changes to the cloud every time I make a small adjustment, followed by the need to retest.
Expected behavior
Being able to change the authentication method and test various authorization policies without the need to push changes to the cloud would significantly enhance the development process.
Reproduction steps
Create a new Amplify project.
Configure authentication using IAM or User Pool.
Define an API with a GraphQL schema.
Run amplify mock api.
Attempt to access the GraphQL schema and documentation.
Example of authorization policy:
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: