Skip to content

Facets aren't working with setSetJson #40

@Fohlen

Description

@Fohlen

Howdy! Unfortunately facet's are not quite working as documented.

When I try the following code:

const wellFormedFixtures = [ 
    { name: 'reprehenderit',
    description: 'Cum tempore excepturi qui numquam illo.',
    location: { name: 'libero', position: [Object] },
    entity: { name: 'maiores', contact: '813 Hayes Ports Bradleyberg' },
    source: { name: 'et', url: 'http://clay.name', aggregator: 0 },
    'location|date': new Date('2018-12-11T21:21:32.455Z'),
    url: 'http://jovanny.org',
    images: [ 'http://lorempixel.com/640/480' ] } 
]

const transaction = dgraphClient.newTxn()
let mutation = new dgraph.Mutation()
mutation.setSetJson(wellFormedFixtures)

The below query:

{
  some_events(func: allofterms(name@., "omnis")) {
    uid,
    name@.,
    location {
      uid,
     name@.,
     position {
     	expand(_all_) 
     }
    } @facets(date: date),
    entity {
     name@.
    },
    source {
    	name@.
    }
  }
}

will not include the date element. However if I manually mutate on ratel via

{
  set {
    <0x29a> <location> <0x29c> (date=2018-11-22T12:10:04.106Z) .
  }
}

it does work fine.
Can you please explain how this is intended to be used, and clarify whether this is a bug or just weirdly documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions