question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Reading JObject from JsonReader

See original GitHub issue

Describe the bug Just trying to get the bare minimum example of hotchocolate.io stuff running, fired up a new project with the starwars template. I then pointed graphiql at it, and it seems like somewhere things go south in trying to get the metadata for the schema.

I’m unsure this is specifically a problem with starwars sample specifically, but also might be a misunderstanding on how graphiql tool works. I tried several queries, but seems like its trying to do its introspection query before anything else anyway.

In analyzing what graphiql is sending to the starwars app, its get request to http://localhost:port/?query=

    query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
        subscriptionType { name }
        types {
          ...FullType
        }
        directives {
          name
          description
          locations
          args {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      description
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      description
      type { ...TypeRef }
      defaultValue
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
  &variables="{}"

To Reproduce Steps to reproduce the behavior:

  1. Initialize new starwars example
  2. Run graphiql with the endpoint set to the hostname and port, dotnet run is using
  3. Attempt to run anything in the user interface
  4. Observe failure, and failure in the console
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: String. Path '', line 1, position 4.
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
   at HotChocolate.AspNetCore.GetRequest.ReadRequest(HttpContext context)
   at HotChocolate.AspNetCore.QueryMiddleware.HandleRequestAsync(HttpContext context, QueryExecuter queryExecuter, CancellationToken cancellationToken)
   at HotChocolate.AspNetCore.QueryMiddleware.Invoke(HttpContext context, QueryExecuter queryExecuter)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Expected behavior Probably return schema information provided by starwars example

Additional context I additionally tried updating to the very latest version of hotchocolate.io, and found that it was reporting the same errors.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ronnyekcommented, Jul 24, 2018

Was able to query and was able to get what I would expect after playing with it a bit more.

0reactions
michaelstaibcommented, Jan 31, 2019

@streamtree here is the bug on which I am tracking the issue https://github.com/ChilliCream/hotchocolate/issues/567

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error reading JObject from JsonReader. Current ...
Cannot deserialize the current JSON array (e.g. [1,2,3] ) into type 'MMI_SpeechRecog.Model.LocationData' because the type requires a JSON object ...
Read more >
Error Reading JObject from JsonReader. Path ", line 0, ...
Answer: To resolve this error, add the Luminate custom domain to the Connector settings. ... After entering the above url, see if the...
Read more >
[Solved]-Error reading JObject from JsonReader. Current ...
Coding example for the question Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path-C#.
Read more >
Solved: PowerApps Solution Error (Error reading JObject fr...
Solved: I have a solutions package migrated from Dev to Prod Environment. It works well before. But suddenly I noticed there is an...
Read more >
Error reading JObject from JsonReader. Path '', line 0, ...
Hello team,. I am running a thread pool of many CdsServiceClient instances with a large number of read/write requests via Cds WebApi.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found