Files
dolt/go/ngql
Erik Arvidsson 28b974f7b9 GraphQL: Add values and keys to maps (#3241)
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.
2017-03-02 14:19:37 -08:00
..

Noms GraphQL

An experimental bridge between noms and GraphQL

Status

  • All Noms types are supported except

    • Blob
    • Type
    • Unions with non-Struct component types
  • Noms collections (List, Set, Map) are expressed as graphql Structs with a list-valued elements field.

    • Lists support argumemts at and count to narrow the range of returned elements
    • Sets and Map support argument count which results in the first count values being returned
    • Map<K,V> is expressed as a list of "entry-struct", e.g.
    • Ref<T> is expressed as a graphql struct with a targetHash and targetValue field.

List:

type FooList {
  size: Float!
  elements: [Foo!]!
}

Set:

type FooSet {
  size: Float!
  elements: [Foo!]!
}

Map:

type StringFooMap {
  size: Float!
  elements: [StringFooEntry!]!
}

type StringFloatEntry {
  key: String!
  value: Float!
}

Ref:

type FooRef {
  targetHash: String!
  targetValue: Foo!
}
  • Mutations not yet supported
  • Higher-level operations (such as set-intersection/union) not yet supported.
  • Perf has not been evaluated or addressed and is probably unimpresssive.