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

[BUG]: GraphQL API schema issue #2593

Open
1 task done
Madhusudhan98 opened this issue Mar 13, 2025 · 1 comment
Open
1 task done

[BUG]: GraphQL API schema issue #2593

Madhusudhan98 opened this issue Mar 13, 2025 · 1 comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@Madhusudhan98
Copy link

Expected Behavior

There should be one block to import the schema file based on context

Actual Behavior

There is no option to import the schema into the graphQL Api with a file based on context

Terraform Version

Terraform 1.11.0
Azurerm : 4.20.0

Affected Resource(s)

GraphQL API

Terraform Configuration Files

Steps to Reproduce

data "azurerm_resource_group" "apimResourceGroup" {
name = "${var.apimResourceGroup}"
}

data "azurerm_api_management" "apim" {
name = "${var.apim_name}"
resource_group_name = data.azurerm_resource_group.apimResourceGroup.name
}

resource "azurerm_api_management_api" "graphql_api" {
name = "customer_bss"
api_management_name = data.azurerm_api_management.apim.name
resource_group_name = data.azurerm_resource_group.apimResourceGroup.name
revision = "1"
display_name = "customer_bss"
path = "graphql"
protocols = ["https"]
subscription_required = false
service_url = "url path "
api_type = "graphql"
depends_on = [data.azurerm_api_management.apim]
}

resource "null_resource" "import_graphql_api" {
provisioner "local-exec" {
command = <<EOT
az login --service-principal --username "${var.client_id}" --password "${var.client_secret}" --tenant "${var.tenant_id}" &&
az apim api import --path "graphql" --resource-group "rg-ne-np-apimgmt-01" --service-name "tt-apim-core-gw-sit" --api-id "customer_bss" --api-type "graphql" --specification-format "GraphQL" --specification-path "../schema.gql" --service-url "url path "
EOT

environment = {
  ARM_CLIENT_ID     = var.client_id
  ARM_CLIENT_SECRET = var.client_secret
  ARM_TENANT_ID     = var.tenant_id
  ARM_SUBSCRIPTION_ID = var.subscription_id
}

}

depends_on = [azurerm_api_management_api.graphql_api]
}

/resource "azurerm_api_management_api_schema" "graphql_schema" {
api_name = azurerm_api_management_api.graphql_api.name
api_management_name = data.azurerm_api_management.apim.name
resource_group_name = data.azurerm_resource_group.apimResourceGroup.name
schema_id = "graphql"
content_type = "application/vnd.ms-azure-apim.graphql.schema"
value = file("../schema.gql")
depends_on = [azurerm_api_management_api.graphql_api,data.azurerm_api_management.apim]
}
/

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Madhusudhan98 Madhusudhan98 added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Mar 13, 2025
@Madhusudhan98 Madhusudhan98 changed the title [BUG]: GraphQL schema issue [BUG]: GraphQL API schema issue Mar 13, 2025
@Madhusudhan98
Copy link
Author

anyone have any views for the above Query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

1 participant