Skip to content

[lsp-server] graphql.vscode-graphql-syntax: Support Python f-strings #4098

@Avasam

Description

@Avasam

Current Behavior (if applicable)

See the following query in Python:

Image

Desired Behavior

How it looks like without f-strings (not perfect, but good enough, applygin the same style to f-strings would work):

Image

Using f-strings and/or format allows me to statically check that all dynamic parts of the query are passed in (using Ruff or a type-checker)

Additional context

No graphql configs.

I do consider switching to GraphQL-style variables ($filter_query), but then I'd loose helpful static tooling and need to add an extra query parser for variable interpolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions