Skip to content

Commit b1bc0ae

Browse files
authored
docs: fix inline examples, deprecation descriptions, type category (#4758)
- Move public documentation sample blocks out of descriptions and into `@example` tags, including root package, parser option, type, schema, astFromValue, and stripIgnoredCharacters docs. - Update every v17 '@deprecated' JSDoc block so the prose itself says the API is deprecated and points users to the replacement or migration path. - Rename the graphql/type Definitions JSDoc category to Types so the generated API docs use the clearer category name.
1 parent a3cd04a commit b1bc0ae

9 files changed

Lines changed: 130 additions & 117 deletions

File tree

src/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,20 @@ export {
508508
// Create a GraphQLType from a GraphQL language AST.
509509
typeFromAST,
510510
// Create a JavaScript value from a GraphQL language AST with a Type.
511-
/** @deprecated use `coerceInputLiteral()` instead - will be removed in v18 */
511+
/**
512+
* Deprecated export retained for compatibility. Use `coerceInputLiteral()`
513+
* instead.
514+
* @deprecated use `coerceInputLiteral()` instead - will be removed in v18
515+
*/
512516
valueFromAST,
513517
// Create a JavaScript value from a GraphQL language AST without a Type.
514518
valueFromASTUntyped,
515519
// Create a GraphQL language AST from a JavaScript value.
516-
/** @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18 */
520+
/**
521+
* Deprecated export retained for compatibility. Use `valueToLiteral()`
522+
* instead, and take care to operate on external values.
523+
* @deprecated use `valueToLiteral()` instead with care to operate on external values - `astFromValue()` will be removed in v18
524+
*/
517525
astFromValue,
518526
// A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system.
519527
TypeInfo,

src/language/parser.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ export interface ParseOptions {
104104
* and arguments on fragment spreads. Fragment variable definitions will be represented
105105
* in the `variableDefinitions` field of the FragmentDefinitionNode.
106106
* Fragment spread arguments will be represented in the `arguments` field of FragmentSpreadNode.
107-
*
108-
* For example:
109-
*
107+
* @example
110108
* ```graphql
111109
* {
112110
* t { ...A(var: true) }
@@ -123,7 +121,7 @@ export interface ParseOptions {
123121
*
124122
* If enabled, the parser will parse directives on directive definitions.
125123
* This syntax is not part of the GraphQL specification and may change.
126-
*
124+
* @example
127125
* ```graphql
128126
* directive @foo @bar on FIELD
129127
* ```

0 commit comments

Comments
 (0)