Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf585aa7

Browse files
samuelAndalonSamuel Vazquez
and
Samuel Vazquez
authored
chore: update v8 docs (#2080)
Co-authored-by: Samuel Vazquez <samvazquez@expediagroup.com>
1 parent2ad2767 commitf585aa7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎website/versioned_docs/version-8.x.x/schema-generator/execution/fetching-data.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,19 @@ You can provide your own custom data fetchers to resolve functions and propertie
5555
to your[SchemaGeneratorConfig](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/SchemaGeneratorConfig.kt).
5656

5757
See our[spring example app](https://github.com/ExpediaGroup/graphql-kotlin/tree/master/examples/server/spring-server) for an example of`CustomDataFetcherFactoryProvider`.
58+
59+
:::info
60+
61+
Currently, graphql-kotlin, through the[KotlinDataFetcherFactoryProvider](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/execution/KotlinDataFetcherFactoryProvider.kt#L62)
62+
creates a[PropertyDataFetcher](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/execution/PropertyDataFetcher.kt)
63+
per source's property. This instance is created[every single time](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/schema/GraphQLCodeRegistry.java#L100)
64+
the graphql-java[DataFetcherFactory](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/schema/DataFetcherFactory.java) is invoked,
65+
which happens to be on runtime per property per GraphQL operation.
66+
67+
If you want to avoid that, use or extend the[SimpleSingletonKotlinDataFetcherFactoryProvider](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/execution/KotlinDataFetcherFactoryProvider.kt#L72) which will provide a
68+
[SingletonPropertyDataFetcher](https://github.com/ExpediaGroup/graphql-kotlin/blob/master/generator/graphql-kotlin-schema-generator/src/main/kotlin/com/expediagroup/graphql/generator/execution/SingletonPropertyDataFetcher.kt) that will host its own singleton factory, and it will store
69+
all`KProperty.Getter<*>`s in a`ConcurrentHashMap`.
70+
71+
This is inspired by this[graphql-java's PR](https://github.com/graphql-java/graphql-java/pull/3754)
72+
73+
:::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp