Problem with adding facets

I’m having some issues adding facets to an edge in my graph. The mutation seems to work but I am unable to query for the facet. Here is my mutation (all the uids already exist):

{
  "set": {
        "uid": "0x62da3",
        "catalog": [
          {
            "uid": "0x1b4"
          },
          {
            "uid": "0x1d6"
          },
          {
            "uid": "0x281"
          },
          {
            "uid": "0x2e5"
          }
        ],
        "catalog|shipping": {
          "0": "ITEM",
          "1": "ITEM",
          "2": "ITEM",
          "3": "ITEM"
        }
    }
}

Which successfully gives me a response:

{
  "data": {
    "code": "Success",
    "message": "Done",
    "queries": null,
    "uids": {}
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 59000,
      "processing_ns": 17881600,
      "assign_timestamp_ns": 2207800,
      "total_ns": 20393000
    },
    "txn": {
      "start_ts": 974,
      "commit_ts": 975,
      "preds": [
        "1-catalog"
      ]
    }
  }
}

So then I try to test that the facet exists with this query:

{
  products(func: uid(0x62da3)) {
    uid
    catalog @facets {
      uid
      region.name
		}
	}
}

But I do not see any facets in the response:

{
  "data": {
    "products": [
      {
        "uid": "0x62da3",
        "catalog": [
          {
            "uid": "0x1b4",
            "region.name": "FL"
          },
          {
            "uid": "0x1d6",
            "region.name": "OOM"
          },
          {
            "uid": "0x281",
            "region.name": "TX"
          },
          {
            "uid": "0x2e5",
            "region.name": "SE"
          }
        ]
      }
    ]
  },
  "extensions": {
    "server_latency": {
      "parsing_ns": 252100,
      "processing_ns": 3035100,
      "encoding_ns": 285000,
      "assign_timestamp_ns": 9195000,
      "total_ns": 13182800
    },
    "txn": {
      "start_ts": 978
    },
    "metrics": {
      "num_uids": {
        "": 1,
        "_total": 11,
        "catalog": 1,
        "region.name": 4,
        "uid": 5
      }
    }
  }
}

Any idea what im doing wrong here?

I just found this other post so going to try this:

I think there may be a gap in the documentation or for this

Pinging @docs

@MichelDiz, is this a bug on Dgraph? or is it only an issue in our docs?

Maybe is confusion in our docs. Both ways in the context of this post are possible. Need to know where is the problem.

The first facets example should be possible, but we have rolled back the “new” format to the “old” one. There is a whole RFC in that context. As far I remember both syntaxes are possible. If for some reason it is not working or not possible anymore. This should be fixed in our docs.

Sorry for going ghost here but yeah the way I tried in this thread did not work for 20.07

Starrett67 There is a really great YouTube in the Dgraph channel I happened to watch someone fo through this exact problem and it is how you requested. The video states it’s not Dgraph intuitive it’s more like a typical network GET flag request with a little Dgraph. Your request likely didn’t create the facet. But if you request with the right format you can see 0 response that tells there wasn’t a created or it then a description if you actual did. It was found just searching Dgraph so I recommend looking there if I didn’t help answer the question but try updating the request.