mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
clean request
This commit is contained in:
@@ -20,13 +20,8 @@ const enhanced = withFragmentContainer<{ data: Data }>(
|
||||
fragment AppContainer on Query
|
||||
@argumentDefinitions(
|
||||
assetID: { type: "ID!" }
|
||||
commentID: { type: "ID" }
|
||||
showAssetList: { type: "Boolean!" }
|
||||
showPermalink: { type: "Boolean!" }
|
||||
) {
|
||||
comment(id: $commentID) @include(if: $showPermalink) {
|
||||
id
|
||||
}
|
||||
assets @include(if: $showAssetList) {
|
||||
...AssetListContainer_assets
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ type Network {
|
||||
type Local {
|
||||
network: Network!
|
||||
assetID: String
|
||||
commentID: String
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
|
||||
@@ -33,19 +33,9 @@ const AppQuery: StatelessComponent<InnerProps> = props => {
|
||||
return (
|
||||
<QueryRenderer<AppQueryVariables, AppQueryResponse>
|
||||
query={graphql`
|
||||
query AppQuery(
|
||||
$assetID: ID!
|
||||
$commentID: ID
|
||||
$showAssetList: Boolean!
|
||||
$showPermalink: Boolean!
|
||||
) {
|
||||
query AppQuery($assetID: ID!, $showAssetList: Boolean!) {
|
||||
...AppContainer
|
||||
@arguments(
|
||||
assetID: $assetID
|
||||
commentID: $commentID
|
||||
showAssetList: $showAssetList
|
||||
showPermalink: $showPermalink
|
||||
)
|
||||
@arguments(assetID: $assetID, showAssetList: $showAssetList)
|
||||
}
|
||||
`}
|
||||
variables={{
|
||||
@@ -53,9 +43,6 @@ const AppQuery: StatelessComponent<InnerProps> = props => {
|
||||
assetID: props.local.assetID || (null as any),
|
||||
// TODO: This is set to false, as server does not support querying assets yet.
|
||||
showAssetList: !props.local.assetID && false,
|
||||
|
||||
commentID: props.local.commentID || (null as any),
|
||||
showPermalink: false,
|
||||
}}
|
||||
render={render}
|
||||
/>
|
||||
@@ -66,7 +53,6 @@ const enhanced = withLocalStateContainer<Local>(
|
||||
graphql`
|
||||
fragment AppQueryLocal on Local {
|
||||
assetID
|
||||
commentID
|
||||
}
|
||||
`
|
||||
)(AppQuery);
|
||||
|
||||
Reference in New Issue
Block a user