boostercloud / booster

Booster Framework
https://www.boosterframework.com
Apache License 2.0
419 stars 87 forks source link

Unable to get the GraphQL API schema #523

Closed rdiaz82 closed 3 years ago

rdiaz82 commented 3 years ago

Bug Report

Current Behavior

GraphQL schema is not working. In any graphQL client if you try to get the schema you get an error 405 (method not allowed). In spite of this error, the GRaphQL API is working because I have checked and I was able to perform a mutation and a query without any problems.

Expected behavior

The expected behavior is to get the graphQL API schema.

Possible Solution

Checking in the API gateway I have seen that the API only has enabled the POST method, So I guess that the problem could be there. During the deployment, the cloud formation template probably is not setting the API gateway for GET operations. Screenshot 2020-12-21 at 23 50 35

Additional information

Environment

javiertoledo commented 3 years ago

@alvaroloes what do you think about it? This is either a bug or we need to clarify this in the documentation...

rdiaz82 commented 3 years ago

I would say that this was working in the past, I wouldn't put my hand over the fire but I have seen schemas in Postwoman.

The only thing that I doubt is If I saw that schema using the kubernetes provider or using the aws provider.

NickSeagull commented 3 years ago

Yes, this was working with AWS, in fact I was using it last month 😱

rdiaz82 commented 3 years ago

could happen that it is fixed because @davidverdu I think that has been able to get it. @davidverdu could you confirm that this is working?

davidverdu commented 3 years ago

@rdiaz82 I haven't touched anything related to GraphQL. Nonetheless, I'm about to refactor the GraphQLGenerator class as is proposed in this issue (https://github.com/boostercloud/booster/issues/541). If there is an error maybe I can try to solve it, but I need more context to do that.

javiertoledo commented 3 years ago

AFAIK when you connect to your API using Postwoman or other GraphQL client, you can see the schema. Are we sure that we want to be able to get the schema using an actual GET operation? I'm not sure this is standard TBH

NickSeagull commented 3 years ago

Schemas are retrieved by POST ing the IntrospectQuery GraphQL query, which is a special GraphQL query that returns the schema, I don't think it should be GETted

davidverdu commented 3 years ago

Definitely it works with POST. I've found that the bug occurs when no readModel is defined in your project. I'm working on the FIX