yelp-fusion: 500 Internal Server Error returned when trying an introspection

I’m trying to use this GraphQL API in Swift, I’m currently using the Apollo library in my project, and to make that library to work I need to download the schema.json as specified over there: Apollo downloading chema. For downloading this schema Apollo provide another library: Apollo Codegen that will download the schema for you.

So I’ve created my token with the authentication guide and run this command line:

$ apollo-codegen download-schema https://api.yelp.com/v3/graphql --output schema.json --header "Authorization: Bearer ###########"

and it return me:

No introspection query result data found, server responded with: {"message":"The server has either erred or is incapable of performing the requested operation.\n\n\n\n\n","code":"500 Internal Server Error","title":"Internal Server Error"}

So I’ve tried one more tool to download the schema to make sure that is not the tool the problem. And with the library graphql-js-schema-fetch I’m receiving the same kind of error:

"The server has either erred or is incapable of performing the requested operation.\n\n\n\n\n","code":"500 Internal Server Error","title":"Internal Server Error"

Maybe I’m missing something, thanks for the help !

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 38 (10 by maintainers)

Most upvoted comments

Hey everyone, I’ve got a fix in-flight but it’ll be a few days before I can push it out. I have a few more kinks I need to iron out and it’ll be set, I’ll keep everyone posted on progress.

Hey everyone, I pushed out a fixed for this. I’ve double checked that apollo-codegen works now. This change also changed the default behavior for the API and expects JSON requests by default. Regular GraphQL requests still work if you pass in the content type header Content-Type: application/graphql.

I put up a small page here explaining: https://www.yelp.com/developers/graphql/guides/requests.

Closing this issue for now, let me know if anything else is still busted!

Yep! We’ll get that updated soon. Also trying to dig into why the other locales are failing, but that’s a separate issue. I’m going to close this one out again

Okay so as far as I can tell our GraphiQL console is fine. The GraphiQL app is including default header that it doesn’t mention called Accept-Language and that’s defaulting to en-US. Unfortunately, that’s not a valid locale for our API, you can find those here. To get the GraphiQL OSX app working, add a new header like this: Accept-Language: en_US. After that, everything started working for me.

I have a ticket internally to improve the error messaging for that particular 400 but I think everything else is working correctly.

I’ve pushed a fix to the 500, looks like that was happening on mismatching content types. Didn’t have a chance to look into graphiql, will try again tomorrow.

@pranayairan – I’ve created a gist with the results that I got by using Yelp’s GraphiQL interface along with the introspection query from the graphql ruby gem.

This is not an official schema. I make no claims that it’s correct or complete, but it worked for me.

https://gist.github.com/conroywhitney/be62505ff16560f1dc26b770695c2cd4

@tomelm Thanks so much for you help 🙏 When I’m adding the header Accept-Language: en_US I’m getting ride of the CLIENT_ERROR error. But as you said it would be a good idea to improve the error message 😄 Thanks again you all for your help !!!

This is interesting, the Same API is working for me. @PhilippeRiegert in case you want to see it working on Android, here is the app I am working on https://github.com/pranayairan/YelpQL. App is still WIP.

I think I’ve figured out what was causing the 500, looks like malformed requests were causing breaks. I’ll push this out tomorrow and see if it helps.

@conroywhitney that might be a bug in our graphiql setup, I’ll take a pass at that tomorrow too. That shouldn’t impact the actual API endpoint though.

I’m getting the same error as well. While trying to load the schema using the graphql-client gem:

GraphQL::Client.load_schema(HTTP)

It was returning a cryptic response

KeyError: key not found: "data"

While searching for a solution to that issue, I found this thread and confirmed using Shopify’s graphql-js-schema-fetch library which @PhilippeRiegert pointed out earlier:

graphql-js-schema-fetch https://api.yelp.com/v3/graphql --header "Authorization: Bearer XXXX"

Which returned the following response:

{"message":"The server has either erred or is incapable of performing the requested operation.\n\n\n\n\n","code":"500 Internal Server Error","title":"Internal Server Error"}

Let me know if I can provide any additional context. Thank you in advance for your help on this!

I’ve heard about similar issues of people using fetch to load data from the Yelp API - I’ll look into it.