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.

Indentation in gql` string literals is wrong, unconfigurable

See original GitHub issue

Version and Environment Details

Operation system: macOS 10.14.5

IDE name and version: InteliJ IDEA Ultimate 2019.1.3

Plugin version: v2.1.0

Expected Behaviour

I should be able to configure the number of spaces used for indentation in .graphql files and in gql string literals. These two indentation setups should be the same.

Actual Behaviour

In my current setup I have my JS files set to indent code at 2 spaces. When these files include gql string literals the indentation within that gql code is 4 spaces. In my fully GraphQL files like thing.graphql the indentation is handled with 2 spaces.

In this issue #180 there is a mention of the GraphQL pane in the Preferences > Code Style. I don’t see this pane any longer. Was it removed, or do I have something misconfigured? Forgive me if this is something wrong about my install. I couldn’t find any details about how to set this in past issues or the existing documentation.

Steps to Reproduce / Link to Repo with Reproduction and Instructions

Create a .js file, add a gql string literal. If you have your Javascript indent spaces set to 2 spaces, the gql fragment will still get set to 4 spaces.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:10

github_iconTop GitHub Comments

4reactions
jimkyndemeyercommented, Jun 13, 2019

Hmm, it appears the the “Other File Types” setting only applies to .graphql files and not injected GraphQL in JavaScript.

I haven’t changed anything between 2.0 and 2.1 so not sure what’s going on. Could be a change in how the IntelliJ platform formats injected languages.

It’s likely that the code style page for GraphQL needs to be reintroduced to fix this.

2reactions
EugeneDraitsevcommented, Jun 13, 2019

@jimkyndemeyer

screencast 2019-06-13 11-18-56 gif sb-779b8554-bYSWsX

Seems like this option is not working too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Indentation in gql` string literals is wrong, unconfigurable #258
In my current setup I have my JS files set to indent code at 2 spaces. When these files include gql string literals...
Read more >
line break or simplify or make long payload data line by line ...
Simply do the string concatenation with the + operator and break the string into small parts. payload := strings.NewReader( "json=%7B%22" + ...
Read more >
Tagged template literals - How the gql`query` syntax works
The typescript syntax declaration looks like this: declare module "graphql-tag" { function gql( literals: ReadonlyArray<string> | Readonly< ...
Read more >
GraphQL specification
If the integer input value represents a value not representable by IEEE 754, a query error should be raised. 3.5.3String. The String scalar...
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