ardatan / ardatan/graphql-tools

[resolvers-composition] Use Namespace-types without depth limit

Open
#4,609 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.4k
Forks
830
Avg merge
10h 59m
Merged PRs (30d)
45

Description

### Issue workflow progress

_Progress of the issue based on the [Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-contributor-workflow)_

- [ ] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
> Make sure to fork this template and run `yarn generate` in the terminal.
>
> Please make sure the GraphQL Tools package versions under `package.json` matches yours.
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review

---

**Describe the bug**

When I use namespace-types I can't use resolvers-composition, because the resolver-composition does not allow depth, but only : `${typeName}.${field}`

Namespace-types : https://graphql-rules.com/rules/mutation-namespaces

Code line : https://github.com/ardatan/graphql-tools/blob/master/packages/resolvers-composition/src/resolvers-composition.ts#L69

**To Reproduce**
Steps to reproduce the behavior:

Namespace-types : https://graphql-rules.com/rules/mutation-namespaces

and

https://www.graphql-tools.com/docs/resolvers-composition#supported-path-matcher-format

**Expected behavior**
Based on the documentation:
![Capture d’écran 2022-08-01 à 16 11 05](https://user-images.githubusercontent.com/31286436/182167607-38fc06b8-b9b4-4ca1-9854-fb19cfe4ce81.png)

If namespace-types are possible we should be able to do this kind of thing:

- Query.User.*
- Query.User.Group.*
- Mutation.User.!{createUser, login}

**Environment:**

- `@graphql-tools/resolvers-composition`:

Thank you in advance for your consideration and feedback

Contributor guide

Open the contributing guide

Research direction

Start with packages/resolvers-composition/src/resolvers-composition.ts at the linked line and read the supported path matcher documentation. Compare the current matcher behavior with the namespace-types examples for nested paths and exclusions. Done means the documented nested patterns such as Query.User.* and Mutation.User.!{createUser, login} are supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.