-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GraphQL as a Git Data source provider. (#6752)
--------- Co-authored-by: “DJ <“dj.howard@networktocode.com> Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com> Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>
- Loading branch information
1 parent
36f882a
commit ce92919
Showing
13 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added support for loading GraphQL queries from a Git repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
nautobot/extras/migrations/0122_add_graphqlquery_owner_content_type.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 4.2.17 on 2025-01-08 16:59 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
import nautobot.extras.utils | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("contenttypes", "0002_remove_content_type_name"), | ||
("extras", "0121_alter_team_contacts"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="graphqlquery", | ||
name="owner_content_type", | ||
field=models.ForeignKey( | ||
blank=True, | ||
default=None, | ||
limit_choices_to=nautobot.extras.utils.FeatureQuery("graphql_query_owners"), | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="graphql_queries", | ||
to="contenttypes.contenttype", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="graphqlquery", | ||
name="owner_object_id", | ||
field=models.UUIDField(blank=True, default=None, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
nautobot/extras/tests/git_data/01-valid-files/graphql_queries/device_interfaces.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
query { | ||
devices { | ||
name | ||
interfaces { | ||
name | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
nautobot/extras/tests/git_data/01-valid-files/graphql_queries/device_names.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
device { | ||
name | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
nautobot/extras/tests/git_data/02-invalid-files/graphql_queries/bad_device_names.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
device { | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.