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

[IJ Plugin] Specific Gradle DSL for endpoints used by the IDE plugin #5783

Open
BoD opened this issue Apr 5, 2024 · 0 comments
Open

[IJ Plugin] Specific Gradle DSL for endpoints used by the IDE plugin #5783

BoD opened this issue Apr 5, 2024 · 0 comments

Comments

@BoD
Copy link
Contributor

BoD commented Apr 5, 2024

Currently, the IDE plugin will look at the end-point and headers configured in the introspection block:

    introspection {
      schemaFile.set(file("src/commonMain/graphql/schema.graphqls"))
      endpointUrl.set("https://confetti-app.dev/graphql")
      headers.set(mapOf("conference" to "androidmakers2024"))
    }

and use them for:

  1. fetching the introspection (via Tools|Apollo|Download schema)
  2. executing the queries (via the 'play' button in the UI)

1 makes sense but 2 is a bit surprising, since it has nothing to do with introspection. Also it would be useful to be able to configure some headers only for execution, and not introspection (i.e. here).

With the GraphQL plugin, the endpoints and headers can be configured with the graphql.config.yml file, but Apollo plugin users are told to not use that file (as the conf is contributed to the GraphQL plugin by the Apollo plugin, using the project's Gradle conf).
(Question: what's the behavior currently when a graphql.config.yml file is present? I think it's ignored, to be confirmed.)

We could have a specific DSL to configure the plugin, syntax TBD, something like:

idePlugin {
  endPoints {
	  endPoint {
	    url.set("...")
	    headers.set(...)
	  }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant