terraform-provider-graphql icon indicating copy to clipboard operation
terraform-provider-graphql copied to clipboard

Providers Docs wrong instructions

Open Jean-Baptiste-Lasselle opened this issue 7 months ago • 0 comments

Hello, thank you so much for this original provider,

To contribute, I found an error in the usage docs.

The provider declaration should be (providers.tf) :


# https://github.com/sullivtr/terraform-provider-graphql/issues/95
terraform {
  required_providers {
    graphql = {
      source  = "sullivtr/graphql"
      # version = "~> 1.0"
      # configuration_aliases = [ mycloud.alternate ]
    }
  }
}

provider "graphql" {
  url = "http://localhost:3000/graphql"
  headers = {
    "header1" = "header1-value"
    "header2" = "header2-value"
  }
  # oauth2_login_query = "mutation loginAPI($apiKey: String!) {loginAPI(apiKey: $apiKey) {accessToken}}"
  # oauth2_login_query_variables = {
  #   "apiKey" = "5555-44-33-99"
  # }
  # oauth2_login_query_value_attribute = "loginAPI.accessToken"
}

After terraform init you get :

image

Jean-Baptiste-Lasselle avatar Nov 19 '23 22:11 Jean-Baptiste-Lasselle