Skip to content

Commit 66a84c1

Browse files
committed
Fix shallow cope issue
1 parent 34b2ecc commit 66a84c1

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/components/QueryEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { JsonPathQueryField } from './JsonPathQueryField';
99
type Props = QueryEditorProps<DataSource, JsonApiQuery, JsonApiDataSourceOptions>;
1010

1111
export const QueryEditor: React.FC<Props> = ({ onRunQuery, onChange, query }) => {
12-
const { fields } = defaults(query, defaultQuery);
12+
const { fields } = defaults(query, { ...defaultQuery, fields: [{ name: '', jsonPath: '' }] });
1313

1414
const onChangePath = (i: number) => (e: string) => {
1515
fields[i] = { ...fields[i], jsonPath: e };

src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export interface JsonApiVariableQuery extends DataQuery {
2020
}
2121

2222
export const defaultQuery: Partial<JsonApiQuery> = {
23-
fields: [{ name: '', jsonPath: '' }],
2423
cacheDurationSeconds: 300,
2524
queryParams: '',
2625
urlPath: '',

0 commit comments

Comments
 (0)