Skip to content

Add comment about debugging config + add comment specifying the language#28

Open
RichardLindhout wants to merge 1 commit intorelay-tools:masterfrom
RichardLindhout:patch-1
Open

Add comment about debugging config + add comment specifying the language#28
RichardLindhout wants to merge 1 commit intorelay-tools:masterfrom
RichardLindhout:patch-1

Conversation

@RichardLindhout
Copy link

No description provided.

Copy link
Member

@alloy alloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for taking a first stab at this! 🙏

const { config } = require("vscode-apollo-relay").generateConfig()
// If you want to debug the config, uncomment the following line
// console.log(JSON.stringify(config))
// You have to restart Visual Code after installing and check the output of Apollo GraphQL (next to the Terimal window)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line would probably work better as its own paragraph outside of the code block and perhaps include a screenshot that shows the output pane, rather than trying to describe it with “next to the Terminal window”. What do you think?

```js
const { config } = require("vscode-apollo-relay").generateConfig()
// If you want to debug the config, uncomment the following line
// console.log(JSON.stringify(config))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think JSON.stringify was introducing all those nulls in the validationRules` array. Perhaps something like this would be better? (Untested code.)

console.log(util.inspect(config, false, null, true))

..............
language: 'typescript',
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section may not be necessary, as I would normally expect this to be implied and applies to all of the config entries. Perhaps the docs should be amended to instead state something like “be sure to specify all configuration required to run relay-compiler in your relay.config.js file”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants