-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Hello!
My intended API is
// either
html`<trigger-mutation refetch-queries="OneQuery,AnotherQuery"></trigger-mutation>`
// or
html`<trigger-mutation .refetchQueries="${['OneQuery', 'AnotherQuery']}"></trigger-mutation>`
As such, I've defined refetchQueries
as:
class TriggerMutation extends ApolloMutation {
@property({ attribute: 'refetch-queries', converter: {
fromAttribute(string: string): string[] {
return !string ? undefined : string.split(',').map(x => x.trim()).filter(Boolean);
},
toAttribute(value: string[]): string {
return Array.isArray(value) ? value.join(',') : null;
},
} })
refetchQueries: string[];
}
Only to get this error:
You are assigning the primitive '"OneQuery,AnotherQuery"' to a non-primitive type 'string[]'. Use '.' binding instead?lit-plugin(no-complex-attribute-binding)(2)
As converter
is intended to cast strings, perhaps this rule should be amended to allow ignoring properties with a converter
or with type: Array
or type: Object
.
KeithHenry, Allcharles, pmcelhaney, LukeAskew, davidenke and 2 more
Metadata
Metadata
Assignees
Labels
No labels