Skip to content

Commit

Permalink
chore: added tests for degraphql_routes entity (#155)
Browse files Browse the repository at this point in the history
* feat: added support for degraphql_routes

* chore: fixed lint issues

* chore: fixed code comments

* chore: addressed PR comments

* fix: renamed plugin_entities to custom_entities for clarity

* fix: fixed comment strings

* fix: fixed schema

* chore: added tests for degraphql_routes entity

* test: fixed tests based on PR suggestions

* test: added integration test for degraphql routes

* fix: fixed testcases based on renames

* style: lint fix

* fix: added PR suggestions
  • Loading branch information
Prashansa-K authored Jan 23, 2025
1 parent 2772231 commit c296111
Show file tree
Hide file tree
Showing 8 changed files with 738 additions and 17 deletions.
8 changes: 8 additions & 0 deletions pkg/file/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,14 @@ func copyToDegraphqlRoute(fcEntity FCustomEntity) (DegraphqlRoute, error) {
degraphqlRoute.Methods = kong.StringSlice("GET")
}

if degraphqlRoute.Service == nil {
return DegraphqlRoute{}, fmt.Errorf("service is required for degraphql_routes")
}

if degraphqlRoute.URI == nil || degraphqlRoute.Query == nil {
return DegraphqlRoute{}, fmt.Errorf("uri and query are required for degraphql_routes")
}

return degraphqlRoute, nil
}

Expand Down
Loading

0 comments on commit c296111

Please sign in to comment.