Skip to content

Small bug fix: Correctly incorporate column offset in decorations#692

Merged
martijnwalraven merged 1 commit intoapollographql:masterfrom
patrys:fix-position-from-source-location
Nov 13, 2018
Merged

Small bug fix: Correctly incorporate column offset in decorations#692
martijnwalraven merged 1 commit intoapollographql:masterfrom
patrys:fix-position-from-source-location

Conversation

@patrys
Copy link
Copy Markdown
Contributor

@patrys patrys commented Nov 13, 2018

This fixes the case where error markers are placed incorrectly when an error refers to a range in the first line of inlined GraphQL.

Previously error locations (and thus editor decorations) would disregard the column offset. Error were reported like this:

foo = gql`query Foo { bar }`
            ^^^

This change makes the location add the column offset it referring to the first line:

foo = gql`query Foo { bar }`
                      ^^^

This fixes the case where error markers are placed incorrectly when an error
refers to a range in the first line of inlined GraphQL.
@apollo-cla
Copy link
Copy Markdown

@patrys: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@martijnwalraven martijnwalraven merged commit 5904bd8 into apollographql:master Nov 13, 2018
@martijnwalraven
Copy link
Copy Markdown
Contributor

Thanks a lot for tracking this down and fixing it, tests are especially appreciated!

@patrys patrys deleted the fix-position-from-source-location branch November 13, 2018 13:50
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.

3 participants