New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new 1.0.11 version broke vars #2832

makitka2007 opened this Issue Dec 19, 2018 · 2 comments


None yet
3 participants
Copy link

makitka2007 commented Dec 19, 2018


entity_key: string @index(exact) .
link_key: string @index(exact) .
link_agg_key: string @index(exact) .
r2mlink: uid @reverse .
m2mlink: uid @reverse .
w2mlink: uid @reverse .
i2wlink: uid @reverse .
r2mlink_agg: uid @reverse .
m2mlink_agg: uid @reverse .
attr_label: string @index(trigram) .
attr_description: string @index(trigram) .
dummy: string .

  set {
    _:entity <entity_key> "c8498990-fe19-11e8-bbf2-9bd27031db92" .
    _:entity <type_Instance> "" .
    _:entity <rel_0aa70b26-6c16-4337-96c9-730b78e8264f> "" .
    _:lnk <link_agg_key> "c8498990-fe19-11e8-bbf2-9bd27031db92|c8498990-fe19-11e8-bbf2-9bd27031db00" .
    _:entity <r2mlink_agg> _:lnk .
    _:lnk <r2mlink_agg> _:concept .

    _:concept <entity_key> "c8498990-fe19-11e8-bbf2-9bd27031db00" .
    _:concept <type_Concept> "" .


  initial_uid as var(func: eq(entity_key, ["c8498990-fe19-11e8-bbf2-9bd27031db92"])) @filter(has(type_Instance) and not(has(dummy)) and (has(rel_0aa70b26-6c16-4337-96c9-730b78e8264f)))

resources_uid as var (func: uid(initial_uid)) @filter()

var(func: uid(resources_uid)) {
links_uid as r2mlink

var(func: uid(resources_uid)) {
r2mlink_agg {
metadata_Concept as r2mlink_agg @filter(has(type_Concept) and not(has(dummy)))

var(func: uid(metadata_Concept)) @cascade {
m2mlink_agg {
cnt_m_Concept as math(1)
m2mlink_agg {
~r2mlink_agg {
~r2mlink_agg @filter(has(rel_0aa70b26-6c16-4337-96c9-730b78e8264f))
metadata_count_Concept as sum(val(cnt_m_Concept))

Concept(func: uid(metadata_Concept), offset : 0, first: 13) {
entityKey: entity_key
attrLabel: attr_label
attrDescription:  attr_description
entityType: entity_type
labels: ~r2mlink @filter(uid(links_uid)) {
metadataLinksCount: val(metadata_count_Concept)



    "errors": [
            "code": "ErrorInvalidRequest",
            "message": "Wrong use of var() with [{metadata_count_Concept 2}]."
    "data": null

on 1.0.10 it worked fine. please, add unit tests/regression or something else not to break existing functionality

@srfrog srfrog added investigate bug and removed investigate labels Dec 19, 2018


This comment has been minimized.

Copy link

danielmai commented Dec 19, 2018

For the record, in v1.0.10, the query from the cluster setup described in this issue returns this:

  "data": {
    "Concept": [
        "entityKey": "c8498990-fe19-11e8-bbf2-9bd27031db00"

Only entityKey is returned from this example data set. The other requested predicates are not in the response (e.g., attrLabel, metadataLinksCount).

@srfrog srfrog self-assigned this Jan 3, 2019

@srfrog srfrog closed this in #2834 Jan 5, 2019


This comment has been minimized.

Copy link

srfrog commented Jan 5, 2019

@makitka2007 please try your query in master, a solution was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment