question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spike: Investigate GraphWrap to see if it is worth implementing

See original GitHub issue

Proposed Changes

I am proposing that we perform a spike with the intent of determining whether it would be feasible and valuable to implement GraphWrap to replace our custom schema generation code in nautobot.core.graphql.

No more than a day should be spent attempting to implement GraphWrap and to identify and assess how it compares to our current custom implementation. The outcome of this spike should be a decision and a level of effort estimation to the tactical steps required to move forward.

Justification

While our current implementation works for the common case there are a growing number of edge cases that we have yet to solve (See: #446, #596, #464). The GraphWrap library appears to do largely the same thing, but requires almost no code on our side “by adding only two lines of code to your django project” (according to the project documentation).

GraphWrap is also fully tested. Ideally, it would result in us having approximately 600 fewer lines of code to maintain, but it remains to be seen whether we would still get the desired behavior we want. All the same, from a maintainability perspective, it would be better to contribute upstream to an already established project than to continue to maintain our own implementation.

Acceptance Criteria

  • Evaluate if we no longer need to restart to update schema changes
  • Evaluate performance impact by switching to GraphWrap
  • Evaluate maintenance difference (currently hybrid of declarative & dynamic vs entirely dynamic with GraphWrap)
  • Determine any breaking schemas changes
  • Evaluate licensing, currentness, and stability of GraphWrap
  • Can we add backwards compatibility to address breaking changes

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
jathanismcommented, Dec 16, 2021

@PaulGilmartin Thank you for taking the time to comment here. I appreciate your interest in helping! This is definitely food for thought.

2reactions
PaulGilmartincommented, Dec 15, 2021

Hi @jathanism

I’m the maintainer/sole author of GraphWrap. I was pleased to see your interest in the library. I just wanted to add to what you remarked above.

First, I believe #446would be solved with GraphWrap. I’m judging this off of the following comment in that thread: "_I worked on this for a while now, sadly none of the approaches that we could come up with proved viable. For posterity, let me document them:

The simplest way to make this work is to generate the schema everytime it is needed (i.e. on every API call). Unfortunately, this is prohibitively slow (on the order of seconds)."_

Generating the schema on API call is exactly what GraphWrap does. I have however never seen it take anything close to the order of a second to generate that schema though - the Python code it uses to do so is really quite light. I have had it running on a production API with possibly 50 distinct schemas and schema generation time is not noticeable. It is perhaps the case however that your API really is huge, I’m not sure.

For the other remaining open issue, I’m not quite familiar enough with your API to be able to comment on whether or not GraphWrap could handle it.

If you do decide to investigate, I’d be more than willing to lend a hand with any issues or questions.

Cheers,

Paul

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL crashes with AssertionError on custom fields with ...
If custom field names with spaces are not valid, this should be ... Spike: Investigate GraphWrap to see if it is worth implementing...
Read more >
How Agile Spikes help to Improve your Agile Product Delivery?
A spike is a user story for which the team cannot estimate the effort needed. In such a case, it is better to...
Read more >
How do you avoid a spike being an implementation? [closed]
The intention of a spike is to find out things. Sometimes you have to write code to find out things. Sometimes by the...
Read more >
Evaluation Guidelines for Air Sampling Methods Utilizing ...
Use spiked samplers in retention efficiency experiments if a test atmosphere cannot be generated. b. Test the effects of low concentration on sample...
Read more >
arXiv:1012.4707v5 [gr-qc] 28 Jan 2012
simplicity, and, ultimately, experience, will tell. ... a quantum of space using standard geometrical relations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found