-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support defining @weak types in docblocks
Reviewed By: alunyov Differential Revision: D40321983 fbshipit-source-id: 55e6df96947b2f8b5aa20ca5f85adec10e8c7299
- Loading branch information
1 parent
317c21c
commit 2bd9788
Showing
16 changed files
with
407 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
compiler/crates/relay-docblock/tests/to_schema/fixtures/weak-type.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
==================================== INPUT ==================================== | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver MyClientType | ||
* | ||
* @weak | ||
* @deprecated Don't use this any more | ||
* | ||
* Check out this awesome client type! | ||
*/ | ||
|
||
export type MyClientType = { | ||
name: string | ||
} | ||
==================================== OUTPUT =================================== | ||
scalar MyClientTypeModel @__RelayCustomScalar(path: "/path/to/test/fixture/weak-type.js", export_name: "MyClientType") | ||
|
||
|
||
type MyClientType @__RelayResolverModel @deprecated(reason: "Don't use this any more") { | ||
__relay_model_instance: MyClientTypeModel | ||
} |
19 changes: 19 additions & 0 deletions
19
compiler/crates/relay-docblock/tests/to_schema/fixtures/weak-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver MyClientType | ||
* | ||
* @weak | ||
* @deprecated Don't use this any more | ||
* | ||
* Check out this awesome client type! | ||
*/ | ||
|
||
export type MyClientType = { | ||
name: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.