Skip to content

Class static side incorrectly extends base class static side ' ... DataSourceTemplate' #2009

@PaulRBerg

Description

@PaulRBerg

Which packages are impacted by your issue?

@graphprotocol/graph-ts

Describe the issue

I am getting these type errors:


apps/flow/generated/templates.ts:9:14 - error TS2417: Class static side 'typeof ContractFlow' incorrectly extends base class static side 'typeof DataSourceTemplate'.
  Types of property 'create' are incompatible.
    Type '(address: Address) => void' is not assignable to type '(name: string, params: string[]) => void'.
      Types of parameters 'address' and 'name' are incompatible.
        Type 'string' is not assignable to type 'Address'.

9 export class ContractFlow extends DataSourceTemplate {
               ~~~~~~~~~~~~

apps/flow/generated/types/templates.ts:9:14 - error TS2417: Class static side 'typeof ContractFlow' incorrectly extends base class static side 'typeof DataSourceTemplate'.
  Types of property 'create' are incompatible.
    Type '(address: Address) => void' is not assignable to type '(name: string, params: string[]) => void'.
      Types of parameters 'address' and 'name' are incompatible.
        Type 'string' is not assignable to type 'Address'.

9 export class ContractFlow extends DataSourceTemplate {

Reproduction

https://github.com/sablier-labs/indexers/tree/main/apps/flow

Steps to Reproduce the Bug or Issue

  1. Go to https://github.com/sablier-labs/indexers/tree/main/apps/flow
  2. Install the dependencies with yarn install
  3. Run yarn tsc --noEmit in the flow directory

Expected behavior

I shouldn't get these type errors

Screenshots or Videos

No response

Platform

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

This is the autogenerated file — the issue is with the create function:

// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

import {
  Address,
  DataSourceTemplate,
  DataSourceContext,
} from "@graphprotocol/graph-ts";

export class ContractFlow extends DataSourceTemplate {
  static create(address: Address): void {
    DataSourceTemplate.create("ContractFlow", [address.toHex()]);
  }

  static createWithContext(address: Address, context: DataSourceContext): void {
    DataSourceTemplate.createWithContext(
      "ContractFlow",
      [address.toHex()],
      context,
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions