diff --git a/config/initializers/nav.rb b/config/initializers/nav.rb index 1aa301a0b9..0f28a0b164 100644 --- a/config/initializers/nav.rb +++ b/config/initializers/nav.rb @@ -5,7 +5,7 @@ .find { |item| item["name"] == "APIs" }["children"] .find { |item| item["name"] == "GraphQL" } - graphql_nav_item["children"] = YAML.load_file(File.join(Rails.root, 'data', 'nav_graphql.yml')) + graphql_nav_item["children"].concat(YAML.load_file(File.join(Rails.root, 'data', 'nav_graphql.yml'))) config.default_nav = Nav.new(nav_data) end diff --git a/data/nav.yml b/data/nav.yml index 45a4ba355d..605e8cae2e 100644 --- a/data/nav.yml +++ b/data/nav.yml @@ -597,7 +597,40 @@ - name: "Suites" path: "apis/rest-api/teams/suites" - name: "GraphQL" - children: [] + children: + - name: Overview + path: apis/graphql-api + - name: Console and CLI tutorial + path: apis/graphql/graphql-tutorial + - name: Cookbook + children: + - name: Overview + path: apis/graphql/graphql-cookbook + - name: Agents + path: apis/graphql/cookbooks/agents + - name: Artifacts + path: apis/graphql/cookbooks/artifacts + - name: Builds + path: apis/graphql/cookbooks/builds + - name: Clusters + path: apis/graphql/cookbooks/clusters + - name: Jobs + path: apis/graphql/cookbooks/jobs + - name: Packages + path: apis/graphql/cookbooks/packages + - name: Pipelines + path: apis/graphql/cookbooks/pipelines + - name: Pipeline templates + path: apis/graphql/cookbooks/pipeline-templates + - name: Rules + path: apis/graphql/cookbooks/rules + - name: Organizations + path: apis/graphql/cookbooks/organizations + - name: Teams + path: apis/graphql/cookbooks/teams + - name: Limits + path: apis/graphql/graphql-resource-limits + - name: "Webhooks" children: - name: "Overview" diff --git a/data/nav_graphql.yml b/data/nav_graphql.yml index d5a2fe2398..0b00d8415e 100644 --- a/data/nav_graphql.yml +++ b/data/nav_graphql.yml @@ -1,37 +1,5 @@ # This file is generated by scripts/generate_graphql_api_content.rb. DO NOT EDIT. --- -- name: Overview - path: apis/graphql-api -- name: Console and CLI tutorial - path: apis/graphql/graphql-tutorial -- name: Cookbook - children: - - name: Overview - path: apis/graphql/graphql-cookbook - - name: Agents - path: apis/graphql/cookbooks/agents - - name: Artifacts - path: apis/graphql/cookbooks/artifacts - - name: Builds - path: apis/graphql/cookbooks/builds - - name: Clusters - path: apis/graphql/cookbooks/clusters - - name: Jobs - path: apis/graphql/cookbooks/jobs - - name: Packages - path: apis/graphql/cookbooks/packages - - name: Pipelines - path: apis/graphql/cookbooks/pipelines - - name: Pipeline templates - path: apis/graphql/cookbooks/pipeline-templates - - name: Rules - path: apis/graphql/cookbooks/rules - - name: Organizations - path: apis/graphql/cookbooks/organizations - - name: Teams - path: apis/graphql/cookbooks/teams -- name: Limits - path: apis/graphql/graphql-resource-limits - name: Queries children: - name: agent diff --git a/scripts/graphql_api_content/nav_data.rb b/scripts/graphql_api_content/nav_data.rb index 08dcb7ffdb..11517f92e0 100644 --- a/scripts/graphql_api_content/nav_data.rb +++ b/scripts/graphql_api_content/nav_data.rb @@ -16,71 +16,6 @@ def convert_to_nav_items(type_set, sub_dir = nil) def generate_graphql_nav_data(type_sets) [ - { - "name" => "Overview", - "path" => "apis/graphql-api" - }, - { - "name" => "Console and CLI tutorial", - "path" => "apis/graphql/graphql-tutorial" - }, - { - "name" => "Cookbook", - "children" => [ - { - "name" => "Overview", - "path" => "apis/graphql/graphql-cookbook" - }, - { - "name" => "Agents", - "path" => "apis/graphql/cookbooks/agents" - }, - { - "name" => "Artifacts", - "path" => "apis/graphql/cookbooks/artifacts" - }, - { - "name" => "Builds", - "path" => "apis/graphql/cookbooks/builds" - }, - { - "name" => "Clusters", - "path" => "apis/graphql/cookbooks/clusters" - }, - { - "name" => "Jobs", - "path" => "apis/graphql/cookbooks/jobs" - }, - { - "name" => "Packages", - "path" => "apis/graphql/cookbooks/packages" - }, - { - "name" => "Pipelines", - "path" => "apis/graphql/cookbooks/pipelines" - }, - { - "name" => "Pipeline templates", - "path" => "apis/graphql/cookbooks/pipeline-templates" - }, - { - "name" => "Rules", - "path" => "apis/graphql/cookbooks/rules" - }, - { - "name" => "Organizations", - "path" => "apis/graphql/cookbooks/organizations" - }, - { - "name" => "Teams", - "path" => "apis/graphql/cookbooks/teams" - } - ] - }, - { - "name" => "Limits", - "path" => "apis/graphql/graphql-resource-limits" - }, { "name" => "Queries", "children" => convert_to_nav_items(type_sets["query_types"], "query") diff --git a/spec/scripts/graphql_api_content/nav_data_spec.rb b/spec/scripts/graphql_api_content/nav_data_spec.rb index 0db680dc79..771ca40774 100644 --- a/spec/scripts/graphql_api_content/nav_data_spec.rb +++ b/spec/scripts/graphql_api_content/nav_data_spec.rb @@ -294,71 +294,6 @@ it "generates nav data correctly" do expect(generate_graphql_nav_data(type_sets)).to eq( [ - { - "name" => "Overview", - "path" => "apis/graphql-api" - }, - { - "name" => "Console and CLI tutorial", - "path" => "apis/graphql/graphql-tutorial" - }, - { - "name" => "Cookbook", - "children" => [ - { - "name" => "Overview", - "path" => "apis/graphql/graphql-cookbook" - }, - { - "name" => "Agents", - "path" => "apis/graphql/cookbooks/agents" - }, - { - "name" => "Artifacts", - "path" => "apis/graphql/cookbooks/artifacts" - }, - { - "name" => "Builds", - "path" => "apis/graphql/cookbooks/builds" - }, - { - "name" => "Clusters", - "path" => "apis/graphql/cookbooks/clusters" - }, - { - "name" => "Jobs", - "path" => "apis/graphql/cookbooks/jobs" - }, - { - "name" => "Packages", - "path" => "apis/graphql/cookbooks/packages" - }, - { - "name" => "Pipelines", - "path" => "apis/graphql/cookbooks/pipelines" - }, - { - "name" => "Pipeline templates", - "path" => "apis/graphql/cookbooks/pipeline-templates" - }, - { - "name" => "Rules", - "path" => "apis/graphql/cookbooks/rules" - }, - { - "name" => "Organizations", - "path" => "apis/graphql/cookbooks/organizations" - }, - { - "name" => "Teams", - "path" => "apis/graphql/cookbooks/teams" - } - ] - }, - { - "name" => "Limits", - "path" => "apis/graphql/graphql-resource-limits" - }, { "name" => "Queries", "children" => [