While it's reasonable to take out the automatic directory
creation for paths that the user types, I think we want the
factory to always be able to use the paths that it authors
underneath the directory the user passed in.
This adds `values` and `keys` to maps.
It also adds List/Set values and Map entries which is the prefered fields in the collections. elements will be removed soon.
Since these functions return a receive-only channel, the
caller _can't_ close the channel it pulls the constructed
collection off of. Since the builder function can easily
know when it's safe to close the channel, it seems fine
to just have NewStreamingWhatever() do the close.
This adds a `keys` argument to Map types. This allows you to get
multiple entries in one line:
```graphql
{
root {
elements(keys: ["a", "c"]) {
key
value
}
}
}
```
Outputs:
```json
{
"data": {
"root": {
"elements": [
{"key": "a", "value": 1},
{"key": "c", "value": 3}
]
}
}
}
```
If `keys` is present all other args are ignored.
Issue #3227
Remove implicit directory creation when creating a local db
- remove Mkdir from NewLocalStore and NewLocalStoreFactory
- add specific error messages for directory does not exist and path is not a directory
- add tests for missing directory and path not directory
fixes: #3222
If key is provided as an argument to a Map/Set elements that defines
where the collection should start iterating from.
If through is provided the iteration will end after visiting through
(or if the key is larger than through)
If both key and at are present, at is ignored.
If key is present but count and through are missing then we use a count
of 1.
Closes#3227
* Implement `TypesIntersect(a, b *types.Type) bool`
fixes: #3203
* Respond to review:
- Require at least one key type to match for map intersction
- Do parallel scan of field when comparing struct
- Add more tests for unions and nested collections
* Rename to ContainCommonSupertype
* Implement `unionTypes(a, b *types.Type) *types.Type`
Implements type merging building off of makeSimplifiedUnion.
The difference between siplified unions and merged types are
in how structs are handled. In the former, we produce the intersection
of input structs to ensure the simplified type is a supertype of the input
types. In the later, we produce the union of the input structs which leads
to a type that is a subtype of all inputs.
Response to review and discussion
- Rename to MakeFullUnion to MakeMergedType
- Revert to old file naming
- Rename makeSimplifiedType to makeSupertype
- MakeUnion delegates to makeSupertype. Should prabably be be renamed, but
this touches a lot of files, so keeping same for now.
fixes: #3204
* Rename to makeSimplifiedType and makeSimplifiedType2
When we have a cyclic type we ended up getting the non complete type out
of the map.
Use graphql.FieldsThunk which is designed to allow recursive types.
We're getting some TCP hangups when trying to talk to S3.
We have an S3 reading rate limiter that's supposed to
prevent issues like this, so the question is whether that's
set too high. Rather than just turning the knob and seeing
if things are OK, this patch adds some logging to verify
that we're actually hitting the rate limiter.
The names of GraphQL types needs to be globally unique. We therefore
name struct types as NAME_HASH (where hash is the first 6 chars of
the noms hash).
Also, make sure that we always map the noms type to the same GraphQL
type, even if the boxedIfScalar is true.
Fixes#3161