question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS: Cant define simple Array schema

See original GitHub issue

Schema copied from the docs:

{
    "friends": {
        "type": Array,
        "schema": [String]
    }
}

Error:

Type ‘StringConstructor[]’ is not assignable to type ‘SchemaDefinition | SchemaDefinition[]’

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Jun 28, 2020

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

1reaction
viruskizzcommented, Jun 16, 2020

The program would run well. To resolve, Add //@ts-ignore above the error like below

{
     // @ts-ignore
    "friends": {
        "type": Array,
        "schema": [String]
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I define an array of objects? - Stack Overflow
@Marilou You can usually get the definition simply by hovering over the userTestStatus variable in your favourite IDE... the TypeScript ...
Read more >
[BUG] can't define a schema which includes a list of objects in ...
Summary: I cant define a schema which includes a list of objects. Code sample: Working version with a javascript model: new dynamoose.
Read more >
TypeScript Arrays - GeeksforGeeks
An array is a user-defined data type. An array is a homogeneous collection of similar types of elements that have a contiguous memory ......
Read more >
GraphQL schema basics
Your GraphQL server uses a schema to describe the shape of your available data. This schema defines a hierarchy of types with fields...
Read more >
TypeScript Array of Objects | Syntax of Declaring the ... - eduCBA
TypeScript Arrays are themselves a data type just like a string, Boolean, ... In the same context, the user cannot declare an interface...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found