mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 16:43:56 +03:00
fix graphql
This commit is contained in:
1 parent
a43295c4d5
commit
64ae142e1d
3 files changed
+12
-8
No files matched your search
@@ -83,11 +83,15 @@ export default class ConversionPanel extends PureComponent {
|
||||
}
|
||||
|
||||
onChange = (newValue: string, leftSplitValue: string) => {
|
||||
const nValue = newValue || this.state.value;
|
||||
const splitValue =
|
||||
leftSplitValue && typeof leftSplitValue === "string"
|
||||
? leftSplitValue
|
||||
: this.state.splitValue;
|
||||
|
||||
debugger;
|
||||
try {
|
||||
const code = this.props.getTransformedValue(
|
||||
newValue || this.state.value,
|
||||
leftSplitValue || this.state.splitValue
|
||||
);
|
||||
const code = this.props.getTransformedValue(nValue, splitValue);
|
||||
|
||||
this.setState({
|
||||
resultValue: code,
|
||||
@@ -104,8 +108,8 @@ export default class ConversionPanel extends PureComponent {
|
||||
}
|
||||
|
||||
this.setState({
|
||||
value: newValue || this.state.value,
|
||||
splitValue: leftSplitValue || this.state.splitValue
|
||||
value: nValue,
|
||||
splitValue: splitValue
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class Json2Ts extends PureComponent {
|
||||
return (
|
||||
<Layout pathname={this.props.url.pathname}>
|
||||
<ConversionPanel
|
||||
leftTitle="GraphQL Schema"
|
||||
leftTitle="Schema"
|
||||
rightTitle="Flow"
|
||||
getTransformedValue={this.getTransformedValue}
|
||||
name={"graphql_to_typescript"}
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class Json2Ts extends PureComponent {
|
||||
return (
|
||||
<Layout pathname={this.props.url.pathname}>
|
||||
<ConversionPanel
|
||||
leftTitle="GraphQL Schema"
|
||||
leftTitle="Schema"
|
||||
rightTitle="TypeScript Definition"
|
||||
getTransformedValue={this.getTransformedValue}
|
||||
name={"graphql_to_typescript"}
|
||||
|
||||
Reference in new issue
Block a user