Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen: Remove default values for primitive schema fields
In the AssemblyScript update a new feature was added to the CLI. Schemas with types such as: ```graphql type Total @entity { id: ID! amount: BigInt } ``` Started to have their setters called on the constructor with the default value for the type, eg: ```typescript export class Total extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); this.set("amount", Value.fromBigInt(BigInt.zero())); } // ... } ``` The problem is that these new set calls were being called with primitives as well, that is a bug. This commit fixes the issue by checking if the field is primitive to avoid generating the wrong call.
- Loading branch information