Skip to content

Commit 1ff6886

Browse files
authored
docs: cleanup tasks/mojos usage documentation (#1766)
1 parent 78d3014 commit 1ff6886

File tree

4 files changed

+18
-72
lines changed

4 files changed

+18
-72
lines changed

website/docs/plugins/gradle-plugin-usage-client.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ sidebar_label: Generating Client
77
import Tabs from '@theme/Tabs';
88
import TabItem from '@theme/TabItem';
99

10+
GraphQL Kotlin plugins can be used to generate a lightweight type-safe GraphQL HTTP clients. See examples below for more
11+
information about the client generating tasks.
12+
1013
## Downloading Schema SDL
1114

1215
GraphQL endpoints are often public and as such many servers might disable introspection queries in production environment.

website/docs/plugins/gradle-plugin-usage-sdl.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ sidebar_label: Generating SDL
77
import Tabs from '@theme/Tabs';
88
import TabItem from '@theme/TabItem';
99

10-
## Generating SDL Example
10+
GraphQL Kotlin follows a code-first approach where schema is auto generated from your source code at runtime. GraphQL Kotlin
11+
plugins can be used to generate schema as a build time artifact. This allows you to seamlessly integrate with various
12+
GraphQL tools that may require a schema artifact as an input (e.g. to perform backwards compatibility checks, etc).
13+
14+
## Generating SDL
1115

1216
GraphQL schema can be generated directly from your source code using reflections. `graphqlGenerateSDL` will scan your
1317
classpath looking for classes implementing `Query`, `Mutation` and `Subscription` marker interfaces and then generates the
@@ -76,7 +80,7 @@ This task does not automatically configure itself to be part of your build lifec
7680
invoke it OR configure it as a dependency of some other task.
7781
:::
7882

79-
## Generating SDL with Custom Hooks Provider Example
83+
## Using Custom Hooks Provider
8084

8185
Plugin will default to use `NoopSchemaGeneratorHooks` to generate target GraphQL schema. If your project uses custom hooks
8286
or needs to generate the federated GraphQL schema, you will need to provide an instance of `SchemaGeneratorHooksProvider`

website/docs/plugins/maven-plugin-usage-client.md

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ title: Maven Plugin Client Usage
44
sidebar_label: Generating Client
55
---
66

7+
GraphQL Kotlin plugins can be used to generate a lightweight type-safe GraphQL HTTP clients. See examples below for more
8+
information about the client generating tasks.
9+
710
## Downloading Schema SDL
811

912
Download SDL Mojo requires target GraphQL server `endpoint` to be specified. Task can be executed directly from the
@@ -451,71 +454,3 @@ different endpoints.
451454
</executions>
452455
</plugin>
453456
```
454-
455-
## Generating SDL Example
456-
457-
GraphQL schema can be generated directly from your source code using reflections. `generate-sdl` mojo will scan your
458-
classpath looking for classes implementing `Query`, `Mutation` and `Subscription` marker interfaces and then generates the
459-
corresponding GraphQL schema using `graphql-kotlin-schema-generator` and default `NoopSchemaGeneratorHooks`. In order to
460-
limit the amount of packages to scan, this mojo requires users to provide a list of `packages` that can contain GraphQL
461-
types.
462-
463-
```xml
464-
<plugin>
465-
<groupId>com.expediagroup</groupId>
466-
<artifactId>graphql-kotlin-maven-plugin</artifactId>
467-
<version>${graphql-kotlin.version}</version>
468-
<executions>
469-
<execution>
470-
<goals>
471-
<goal>generate-sdl</goal>
472-
</goals>
473-
<configuration>
474-
<packages>
475-
<package>com.example</package>
476-
</packages>
477-
</configuration>
478-
</execution>
479-
</executions>
480-
</plugin>
481-
```
482-
483-
## Generating SDL with Custom Hooks Provider Example
484-
485-
Plugin will default to use `NoopSchemaGeneratorHooks` to generate target GraphQL schema. If your project uses custom hooks
486-
or needs to generate the federated GraphQL schema, you will need to provide an instance of `SchemaGeneratorHooksProvider`
487-
service provider that will be used to create an instance of your custom hooks.
488-
489-
`generate-sdl` mojo utilizes [ServiceLoader](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ServiceLoader.html)
490-
mechanism to dynamically load available `SchemaGeneratorHooksProvider` service providers from the classpath. Service provider
491-
can be provided as part of your project, included in one of your project dependencies or through explicitly provided artifact.
492-
See [Schema Generator Hooks Provider](./hooks-provider.mdx) for additional details on how to create custom hooks service provider.
493-
Configuration below shows how to configure GraphQL Kotlin plugin with explicitly provided artifact to generate federated
494-
GraphQL schema.
495-
496-
```xml
497-
<plugin>
498-
<groupId>com.expediagroup</groupId>
499-
<artifactId>graphql-kotlin-maven-plugin</artifactId>
500-
<version>${graphql-kotlin.version}</version>
501-
<executions>
502-
<execution>
503-
<goals>
504-
<goal>generate-sdl</goal>
505-
</goals>
506-
<configuration>
507-
<packages>
508-
<package>com.example</package>
509-
</packages>
510-
</configuration>
511-
</execution>
512-
</executions>
513-
<dependencies>
514-
<dependency>
515-
<groupId>com.expediagroup</groupId>
516-
<artifactId>graphql-kotlin-federated-hooks-provider</artifactId>
517-
<version>${graphql-kotlin.version}</version>
518-
</dependency>
519-
</dependencies>
520-
</plugin>
521-
```

website/docs/plugins/maven-plugin-usage-sdl.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ title: Maven Plugin SDL Usage
44
sidebar_label: Generating SDL
55
---
66

7-
## Generating SDL Example
7+
GraphQL Kotlin follows a code-first approach where schema is auto generated from your source code at runtime. GraphQL Kotlin
8+
plugins can be used to generate schema as a build time artifact. This allows you to seamlessly integrate with various
9+
GraphQL tools that may require a schema artifact as an input (e.g. to perform backwards compatibility checks, etc).
10+
11+
## Generating SDL
812

913
GraphQL schema can be generated directly from your source code using reflections. `generate-sdl` mojo will scan your
1014
classpath looking for classes implementing `Query`, `Mutation` and `Subscription` marker interfaces and then generates the
@@ -32,7 +36,7 @@ types.
3236
</plugin>
3337
```
3438

35-
## Generating SDL with Custom Hooks Provider Example
39+
## Using Custom Hooks Provider
3640

3741
Plugin will default to use `NoopSchemaGeneratorHooks` to generate target GraphQL schema. If your project uses custom hooks
3842
or needs to generate the federated GraphQL schema, you will need to provide an instance of `SchemaGeneratorHooksProvider`

0 commit comments

Comments
 (0)