magento / magento/magento-coding-standard

Warnings on well formatted GraphQL files

Open
#465 2 comments 0 reactions 1 assignee Claimed by @p-makowski View on GitHub
bug Progress: PR created
Dominant language
PHP
Stars
375
Forks
165
PR merge metrics
No merged PRs in 30d

Description

### Preconditions
The bug is reproducible in custom Magento modules that have schema.graphqls files written in readable manner, so e.g. with new line breaks or indentation.

A rule that those not work well with well formatted files is Magento2.GraphQL.ValidTypeName.NotCamelCaps.

### Steps to reproduce
1. Create a well formatted schema.graphqls file or fix it with Prettier
```
type CartCampaign
@doc(
description: "CartCampaign returns the discount amount set in the quote"
) {
full_discount_amount: Float
}
```
2. Run code sniffer
`vendor/bin/phpcs -s schema.graphqls`

### Expected result
No warnings discovered.

### Actual result
```
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------
1 | WARNING | Type name "CartCampaign
| | " is not in PascalCase format (Magento2.GraphQL.ValidTypeName.NotCamelCaps)
------------------------------------------------------------------------------------------------------------------------
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.