ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.03k stars 723 forks source link

Possibility to view the error on an invalid graphql schema (Banana Cake Pop) #6335

Closed tauchmi closed 4 weeks ago

tauchmi commented 10 months ago

Product

Banana Cake Pop

Is your feature request related to a problem?

I have multiple graphql schemas which come from different systems, one seems to be invalid. Banana Cake Pop does show a red button in the reload schema button top right but gives no further clues. The "Schema Reference" tab shows "Schema unavailable". No further information on what the problem is.

The solution you'd like

The system providing a section with information what the problem is (duplicate naming, etc.) or at least a console.log with a bit of information.

michaelstaib commented 10 months ago

So Hot Chocolate never composes a schema?

tauchmi commented 10 months ago

The backend system that is failing is not using hot chocolate.

michaelstaib commented 10 months ago

Then it's not possible as the GraphQL server would need to be able to expose the error to BCP. If the server does that you can have a look at the new operations tab that also shows the introspection queries and their errors.

image
michaelstaib commented 10 months ago

cc @rstaib @artola

tauchmi commented 10 months ago

Well, the thing is the introspection queries do not indicate an error. In e.g. Altair I do get a message like "invalid schema" but also without more information.

The endpoint was corrected and Altair is working, but BCP still indicates an error (red dot) and schema unavailable.

rstaib commented 10 months ago

@tauchmi which version of BCP?

image

tauchmi commented 10 months ago

image

7.0.0

rstaib commented 10 months ago

And what do you see in the log panel?

image

tauchmi commented 10 months ago

image

rstaib commented 10 months ago

Hmmm strange. Here in the log console we can see that the introspection query went successful. Could you please click the schema reload icon and see what is happening in the console?

rstaib commented 10 months ago

Ahhh and please check the result of the last log entry Introspection: http://localhost:5000/graphql

rstaib commented 10 months ago

The request is showing a 200 status code but it could be that the GraphQL response contains errors.

rstaib commented 10 months ago

If that is the case we could extract the error and show it in the console as well

tauchmi commented 10 months ago

The logs do not indicate or contain any errors on the schema reload, but still bcp ist not able to display the schema.

Is the source code of bcp public?

image image image

rstaib commented 10 months ago

No the source code is not public. it's a free to use tool though. There is something strange ongoing. Could you please make sure that you have saved all your documents, then click the sync button in the footer, sign-out from BCP, remove the IndexedDB for BCP and then refresh the browser.

image

rstaib commented 10 months ago

A few more questions:

  1. Would it be also possible to share the Introspection Result with me so I can test if it's valid?
  2. What GraphQL server are you using?
tauchmi commented 10 months ago

Deleting the database fixed the issue!

I guess when the api had an issue, this persisted in the database and did not refresh after correcting it?

Unfortunately I cannot share the result. I hope you would not ask ;) The server is graphql.net 2.0.0-alpha something

rstaib commented 10 months ago

Okay, so it works now after following my steps I assume? I will check then why the introspection result get stuck in the DB.

tauchmi commented 10 months ago

That's correct.

I'm not 100% sure what the issue was, it seems a name was used multiple times for types and/or query.

pkese commented 1 month ago

I'm having the same issue. If I change the schema, I'm getting 'Schema unavailkable' error.

Deleting Indexed-Db fixes the problem.

I'm using BCP 15.0.4, DB version 19

pkese commented 4 weeks ago

Oh, I noticed, that there was indeed something wrong with my schema. Some types were apparently using space characters in names:

Names must only contain [_a-zA-Z0-9] but "technologymonitoring_ai climate_job market - ai_countries_per_month_Filter" does not.

It would be nice if BCP could warn about such things instead of simply failing.

michaelstaib commented 4 weeks ago

@rstaib can this one be closed?

rstaib commented 4 weeks ago

@michaelstaib Yeah, can be closed now.