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.

Command 'Execute GraphQL Operations' resulted in an error (Cannot read property 'uri' of undefined)

See original GitHub issue

Actual Behavior

Executing Query from VS Code doesn’t show any results and throws error: “Command ‘Execute GraphQL Operations’ resulted in an error (Cannot read property ‘uri’ of undefined)”

Expected Behavior

Should show Query result

Steps to Reproduce the Problem Or Description

  1. Install vscode-graphql
  2. add ‘graphql.config.js’ to project root
  3. add following content to graphql.config.js
const { projectConfig } = require('./project.config.js')

module.exports = {
  schema: './graphql/schema/_schema.graphql',
  documents: [':./graphql/queries/*.js'],
  extensions: {
    endpoints: {
      default: {
        url: projectConfig.apiUrl,
      },
    },
  },
}

assuming projectConfig.apiUrl is set to a string represantion of a valid graphql endpoint.

  1. Open any Query.js file in ~/graphql/queries/ .
  2. Click “Execute Query” as context option OR open command pallette and enter “Execute GraphQL Operations”

Specifications

  • GraphQL for VSCode Extension Version: v0.3.13
  • VSCode Version: 1.52.1
  • OS Name: macOS Big Sur
  • OS Version: 11.1

Logs Of TS Server || GraphQL Language Service

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
egowardcommented, Feb 8, 2022

Thanks for the pointers, both. I am up and running with my own schema & server. My problem was basically user error, and perhaps some broken typescript setup stopping me following the instructions in the readme.

Naming things is hard, but in a picture - HowToExecuteQuery

4reactions
tepenecommented, Dec 23, 2021

Having the same issue:

image

Steps to Reproduce the Problem Or Description

  1. install vscode-graphql
  2. add .graphqlrc.yaml to project root
  3. add following content to .graphqlrc.yaml
schema:
  - http://172.17.0.1:8080/v1/graphql:
      headers:
        x-hasura-admin-secret: "password"
extension:
  endpoints:
    default:
      url: http://172.17.0.1:8080/v1/graphql
      headers:
        x-hasura-admin-secret: "password"
  1. Open any Query file
  2. Open command palette and enter “Execute GraphQL Operations”

Specifications

  • GraphQL for VSCode Extension Version: v0.3.41
  • VSCode Version: 1.63.2
  • OS: Debian Buster (VSCode devcontainer)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Command 'Execute GraphQL Operations' resulted in an error ...
Actual Behavior Executing Query from VS Code doesn't show any results ... resulted in an error (Cannot read property 'uri' of undefined)" ...
Read more >
GraphQL: TypeError: Cannot read property of undefined
I see, you are trying to access user object from context. Please check the context definition. It should return an object containing user...
Read more >
Cannot read property 'launchAPI' of undefined in Apollo ...
Hi, there. I'm trying the following query in Apollo Graphql Studio while checking the tutorial. query GetLaunches { launches { id mission {...
Read more >
Changelog - Cypress Documentation
Cypress no longer throws the error "cannot read property split of undefined" in certain circumstances when application errors are thrown. Fixes #17378.
Read more >
cannot read properties of undefined (reading 'map') typescript
This error occurs because react-scripts has a direct dependency on the 2.xx range of @typescript-eslint/parser and @typescript-eslint/eslint-plugin . You can ...
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