Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
852 stars 172 forks source link

DAB integration with SWA : /data-api/graphql endpoint shows error eventhough graphql endpoint works #1124

Open sajeetharan opened 1 year ago

sajeetharan commented 1 year ago

Once the link is configured and app is deployed, the graphql endpoint in the browser shows an error

https://purple-cliff-02c39bb10.2.azurestaticapps.net/data-api/graphql

Probably, because we are not showing the Banana Cake Pop UI Screenshot 2023-01-27 at 21 04 32

We should not show the Banana Cake Pop errors at least when user invokes the graphql endpoint, Screenshot 2023-01-30 at 22 44 35

seantleonard commented 1 year ago

As discussed in our team meeting, this is because BananaCakePop is disabled in "Production" mode. Production mode is a configuration flag in the engine runtime configuration. Because your GET request does not include a GraphQL request payload, the error you receive is expected.

Agreed that we could look into translating into a friendlier message.

abhishekkumams commented 1 year ago

Few Questions

  1. Does this seem like a better response in case user tries to access the /graphql endpoint through browser in production mode? image

  2. I'm thinking of not having the extension section in the response as it wouldn't add much value to the users but keeping it logged in the error logs so developers are aware of it. any concerns with that?

  3. @sajeetharan , How did you get the HC0012 error, i'm not able to replicate it. can you share the steps please?

sajeetharan commented 1 year ago

@abhishekkumams I just checked this again with the latest package , looks like I am not getting this anymore. The 2nd screenshot is actually from Postman client. I think we can ignore this for the moment as we are showing proper message

abhishekkumams commented 1 year ago

@Sajee, what do you think the proper error message should be for the first scenario?

seantleonard commented 10 months ago

may not be issue with latest HotChocolate. @sajeetharan can you check again with latest version of 0.9.7 dab? Error message/HTTP code may be different