Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Added Relate and Graph Semantics tests #83

Merged
merged 3 commits into from
Oct 5, 2022

Conversation

Du-z
Copy link
Collaborator

@Du-z Du-z commented Oct 3, 2022

Added a test for creating Relations and the querying them via Graph Semantics.

The RPC queries are failing while the REST ones pass.

The failing query RELATE $thing1->hasOtherThing->$thing2; produces the following JSON:

{
  "id": "qrBo3bkT",
  "method": "query",
  "params": [
    "RELATE $thing1->hasOtherThing->$thing2;",
    {
      "thing1": "object1:VbNy93UFUX",
      "thing2": "object2:VbNy93UFUX"
    }
  ]
}

Tweaking the query slightly to look like RELATE $thing1 -> hasOtherThing -> $thing2; or RELATE ($thing1)->hasOtherThing->($thing2) passes.

{
  "id": "n3pJe7ja",
  "method": "query",
  "params": [
    "RELATE $thing1 -> hasOtherThing -> $thing2;",
    {
      "thing1": "object1:7VWcpn9fO1",
      "thing2": "object2:7VWcpn9fO1"
    }
  ]
}

The two RPC documents looks functionally the same

@Du-z
Copy link
Collaborator Author

Du-z commented Oct 5, 2022

Looks like it is a bug, I have worked around it in this test

surrealdb/surrealdb#1313

Copy link
Collaborator

@ProphetLamb ProphetLamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thanks for the PR

@ProphetLamb ProphetLamb merged commit 777f0a2 into master Oct 5, 2022
@ProphetLamb ProphetLamb deleted the relate_and_graph_semantics branch October 5, 2022 14:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants