| 1 |
__typename /foo/bar # possible, usual use case |
| 2 |
require="__a//b" __typename /foo/bar # possible and happens often for __a/$id in loops |
| 3 |
|
| 4 |
__typename /foo/bar/ # trailing slash will be stripped, can be documented |
| 5 |
|
| 6 |
__typename /foo//bar//baz # // will be converted to / implicitly through fs; error prone; disallow |
| 7 |
|
| 8 |
require="__a//b//c" __typename # // will be converted to / implicitly through fs; error prone; disallow |
| 9 |
|
| 10 |
|
| 11 |
Solution: |
| 12 |
|
| 13 |
1) allow require __a//b: type __a, object id /b |
| 14 |
=> strip first slash of object id, as we do in non-dep-mode |
| 15 |
2) allow _one_ trailing /: __type /foo/bar/ and require="__foo/abc/" |
| 16 |
=> strip one leading slash of object id |
| 17 |
3) disallow // within object id |
| 18 |
4) disallow starting or ending / after 1) and 2) |