Open nwcasebolt opened 4 months ago
Hi @nwcasebolt! You mentioned a glob pattern in the issue title, but I don't see any configs in the provided code or in steps to reproduce. Could you please elaborate?
Hi @nwcasebolt! You mentioned a glob pattern in the issue title, but I don't see any configs in the provided code or in steps to reproduce. Could you please elaborate?
Certainly, @vepanimas. I see how my title is misleading, since it refers to a specific part of the problem I have rather than the holistic issue. I've modified the title and updated my reproduction steps to be, I hope, more clear.
@nwcasebolt Thank you for the clarification! If you stop just after the first step after downloading all the corresponding projects and add no configs at all it will work out of the box. If you create a configuration, I still need to see its content and know the place where you put it, it's important.
For example, if you put such graphql.config.yml
in the project root, all directives will be resolved:
schema:
- app/code/etc/schema.graphqls
- vendor/magento/module-graph-ql/etc/schema.graphqls
documents: '**/*.graphql'
If you don't want to specify exact paths, this also will work:
schema: '**/*.graphqls'
documents: '**/*.graphql'
or to include not only .graphqls
, but also regular .graphql
files:
schema: '**/*.graphql*'
documents: '**/*.graphql'
Describe the bug
Magento 2.4.6-p2 defines its own directives (such as
@doc
and@resolver
) atvendor/magento/module-graph-ql/etc/schema.graphqls
, but custom project files inapp/code
show errors on these directives. When I copy Magento's schema file tovendor/magento
, these errors resolve. If I place the file in any lower subdirectory, the errors return. The plugin seems unable to assembleschema.graphqls
files from subdirectories lower thanvendor/magento/
. This obtains whether I rely on the plugin's OOB implementation or explicitly configure a basic configuration or composite schema.To Reproduce
Set Up Initial State
app/code
directory and avendor/magento/module-graph-ql
directory.app/code/
. MagePlaza's SMTP-2 module will work.vendor/magento/quote-graph-ql
.OOB Configuration
etc
and observe errors on Magento's directives.Basic Configuration
app/code
schema files.Composite Schemas
app/code
schema files.Undesirable Resolution
vendor/magento/quote-graph-ql/etc
tovendor/magento
.Expected behavior The plugin recurses into all project subdirectories and assembles all matching schema files, without resorting to copying Magento's custom schema to a higher directory.
Version and Environment Details Operation system: macOS Sonoma 14.2.1 IDE name and version: PhpStorm 2023.3.4 Plugin version: 233.13135.65