Skip to content
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

Graphql helper #1733

Merged
merged 18 commits into from
Sep 2, 2024
Merged

Graphql helper #1733

merged 18 commits into from
Sep 2, 2024

Conversation

miratepuffin
Copy link
Collaborator

@miratepuffin miratepuffin commented Aug 28, 2024

What changes were proposed in this pull request?

  • Tided up graphql pytests as having a single file was driving me mad
  • Broke the graphql python module into smaller files
  • Exposed delete on edge in python
  • Fixed missing DTime parsing on Python properties
  • Added RemoteGraph, RemoteNode and RemoteEdge classes to wrap updates to graph on a server
  • Added below functions with tests to these classes
  • Made Properties options in add_updates for Node and Edge in Graphql
  • Added some helper functions in make for formatting rust/python, building docs and building python
  • fixed a bug in batch add nodes, where you couldn't just add the node_type.
  • Fixed a bug in import_node(s)/import_edge(s) when the graph is indexed with ints

Functions added

  • new_graph
  • client.graph(path=).add_node()
  • client.graph(path=).add_nodes()
  • client.graph(path=).add_edge()
  • client.graph(path=).add_edges()
  • client.graph(path=).delete_edge()
  • client.graph(path=).add_properties()
  • client.graph(path=).add_constant_properties()
  • client.graph(path=).update_constant_properties()
  • client.graph(path=).node(name=).add_constant_properties()
  • client.graph(path=).node(name=).set_node_type()
  • client.graph(path=).node(name=).update_constant_properties()
  • client.graph(path=).node(name=).add_updates()
  • client.graph(path=).edge(src=,dst=).delete()
  • client.graph(path=).edge(src=,dst=).add_constant_properties()
  • client.graph(path=).edge(src=,dst=).update_constant_properties()
  • client.graph(path=).edge(src=,dst=).add_updates()

Why are the changes needed?

Dealing with graphql strings in python is a pain

Does this PR introduce any user-facing change? If yes is this documented?

yes and yes

How was this patch tested?

New tests added for each function

Issues

fixes #1723

Ben Steer and others added 4 commits August 28, 2024 15:03
Fixed missing DTime on python properties
Fixed Prop->Graphql parsing
Added add_constant_properties and update_constant_properties to graph
Copy link
Collaborator

@ljeub-pometry ljeub-pometry left a comment

Choose a reason for hiding this comment

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

The APIs look good, the Jinja templating for the queries is questionable but we can find a better solution for that later as we expand the RemoteGraph functionality. Some docstrings need a bit of cleanup.

@miratepuffin miratepuffin merged commit a6eb846 into master Sep 2, 2024
19 checks passed
@miratepuffin miratepuffin deleted the graphql-helper-functions branch September 2, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helper functions for GraphQL graph mutations
2 participants