Skip to content

Commit 01ee2b8

Browse files
authored
Add Kdoc for parseAsXyz(filePath: ...) (#6421)
1 parent 5e780aa commit 01ee2b8

File tree

1 file changed

+14
-3
lines changed
  • libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo/ast

1 file changed

+14
-3
lines changed

libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo/ast/api.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ fun String.toGQLSelections(options: ParserOptions = ParserOptions.Default): List
140140
* You can then use [validateAsSchema] to validate the contents and get a [Schema].
141141
* Or use [validateAsExecutable] to validate the contents get a list of operations/fragments.
142142
*
143-
* Closes [BufferedSource]
143+
* Closes [BufferedSource].
144144
*
145+
* @param filePath the path of a file on the host filesystem where the source is coming from. If provided, [filePath]
146+
* is used to display context for parsing errors. If the source doesn't come from a file, pass `null`.
145147
* @return a [GQLResult] with either a non-null [GQLDocument] or a list of issues.
146148
*/
147149
@ApolloExperimental
@@ -152,7 +154,10 @@ fun BufferedSource.parseAsGQLDocument(filePath: String? = null, options: ParserO
152154
/**
153155
* Parses the source to a [GQLValue], validating the syntax but not the contents of the value.
154156
*
155-
* Closes [BufferedSource]
157+
* Closes [BufferedSource].
158+
*
159+
* @param filePath the path of a file on the host filesystem where the source is coming from. If provided, [filePath]
160+
* is used to display context for parsing errors. If the source doesn't come from a file, pass `null`.
156161
*/
157162
@ApolloExperimental
158163
fun BufferedSource.parseAsGQLValue(filePath: String? = null, options: ParserOptions = ParserOptions.Default): GQLResult<GQLValue> {
@@ -162,7 +167,10 @@ fun BufferedSource.parseAsGQLValue(filePath: String? = null, options: ParserOpti
162167
/**
163168
* Parses the source to a [GQLType], validating the syntax but not the contents of the value.
164169
*
165-
* Closes [BufferedSource]
170+
* Closes [BufferedSource].
171+
*
172+
* @param filePath the path of a file on the host filesystem where the source is coming from. If provided, [filePath]
173+
* is used to display context for parsing errors. If the source doesn't come from a file, pass `null`.
166174
*/
167175
@ApolloExperimental
168176
fun BufferedSource.parseAsGQLType(filePath: String? = null, options: ParserOptions = ParserOptions.Default): GQLResult<GQLType> {
@@ -173,6 +181,9 @@ fun BufferedSource.parseAsGQLType(filePath: String? = null, options: ParserOptio
173181
* Parses the source to a [List]<[GQLSelection]>, validating the syntax but not the contents of the selections.
174182
*
175183
* Closes [BufferedSource]
184+
*
185+
* @param filePath the path of a file on the host filesystem where the source is coming from. If provided, [filePath]
186+
* is used to display context for parsing errors. If the source doesn't come from a file, pass `null`.
176187
*/
177188
@ApolloExperimental
178189
fun BufferedSource.parseAsGQLSelections(

0 commit comments

Comments
 (0)