Browse Source

query node - happenedIn rename to createdInBlock

ondratra 3 years ago
parent
commit
cccc93261a
35 changed files with 202 additions and 308 deletions
  1. 2 2
      query-node/generated/graphql-server/db/migrations/channelCategoriesByName.migration.ts
  2. 2 2
      query-node/generated/graphql-server/db/migrations/membersByHandle.migration.ts
  3. 2 2
      query-node/generated/graphql-server/db/migrations/search.migration.ts
  4. 2 2
      query-node/generated/graphql-server/db/migrations/videoCategoriesByName.migration.ts
  5. 1 1
      query-node/generated/graphql-server/package.json
  6. 3 6
      query-node/generated/graphql-server/src/modules/channel-category/channel-category.model.ts
  7. 4 4
      query-node/generated/graphql-server/src/modules/channel-category/channel-category.resolver.ts
  8. 27 45
      query-node/generated/graphql-server/src/modules/channel/channel.model.ts
  9. 4 4
      query-node/generated/graphql-server/src/modules/channel/channel.resolver.ts
  10. 3 6
      query-node/generated/graphql-server/src/modules/curator-group/curator-group.model.ts
  11. 4 4
      query-node/generated/graphql-server/src/modules/curator-group/curator-group.resolver.ts
  12. 18 33
      query-node/generated/graphql-server/src/modules/data-object/data-object.model.ts
  13. 4 4
      query-node/generated/graphql-server/src/modules/data-object/data-object.resolver.ts
  14. 4 4
      query-node/generated/graphql-server/src/modules/enums/enums.ts
  15. 1 4
      query-node/generated/graphql-server/src/modules/featured-video/featured-video.model.ts
  16. 4 4
      query-node/generated/graphql-server/src/modules/featured-video/featured-video.resolver.ts
  17. 4 12
      query-node/generated/graphql-server/src/modules/language/language.model.ts
  18. 4 4
      query-node/generated/graphql-server/src/modules/language/language.resolver.ts
  19. 4 8
      query-node/generated/graphql-server/src/modules/license/license.model.ts
  20. 4 4
      query-node/generated/graphql-server/src/modules/license/license.resolver.ts
  21. 12 20
      query-node/generated/graphql-server/src/modules/membership/membership.model.ts
  22. 4 4
      query-node/generated/graphql-server/src/modules/membership/membership.resolver.ts
  23. 11 12
      query-node/generated/graphql-server/src/modules/variants/variants.model.ts
  24. 3 6
      query-node/generated/graphql-server/src/modules/video-category/video-category.model.ts
  25. 4 4
      query-node/generated/graphql-server/src/modules/video-category/video-category.resolver.ts
  26. 4 8
      query-node/generated/graphql-server/src/modules/video-media-encoding/video-media-encoding.model.ts
  27. 4 4
      query-node/generated/graphql-server/src/modules/video-media-encoding/video-media-encoding.resolver.ts
  28. 10 15
      query-node/generated/graphql-server/src/modules/video-media-metadata/video-media-metadata.model.ts
  29. 4 4
      query-node/generated/graphql-server/src/modules/video-media-metadata/video-media-metadata.resolver.ts
  30. 29 56
      query-node/generated/graphql-server/src/modules/video/video.model.ts
  31. 4 4
      query-node/generated/graphql-server/src/modules/video/video.resolver.ts
  32. 1 1
      query-node/mappings/src/common.ts
  33. 2 2
      query-node/mappings/src/content/video.ts
  34. 1 2
      query-node/mappings/src/membership.ts
  35. 8 11
      query-node/schema.graphql

+ 2 - 2
query-node/generated/graphql-server/db/migrations/channelCategoriesByName.migration.ts

@@ -1,7 +1,7 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
-export class ChannelCategoriesByNameMigration1617193983915 implements MigrationInterface {
-    name = 'channelCategoriesByNameMigration1617193983915'
+export class ChannelCategoriesByNameMigration1617875747203 implements MigrationInterface {
+    name = 'channelCategoriesByNameMigration1617875747203'
 
     public async up(queryRunner: QueryRunner): Promise<void> {
         // TODO: escape 

+ 2 - 2
query-node/generated/graphql-server/db/migrations/membersByHandle.migration.ts

@@ -1,7 +1,7 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
-export class MembersByHandleMigration1617193983916 implements MigrationInterface {
-    name = 'membersByHandleMigration1617193983916'
+export class MembersByHandleMigration1617875747204 implements MigrationInterface {
+    name = 'membersByHandleMigration1617875747204'
 
     public async up(queryRunner: QueryRunner): Promise<void> {
         // TODO: escape 

+ 2 - 2
query-node/generated/graphql-server/db/migrations/search.migration.ts

@@ -1,7 +1,7 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
-export class SearchMigration1617193983914 implements MigrationInterface {
-    name = 'searchMigration1617193983914'
+export class SearchMigration1617875747202 implements MigrationInterface {
+    name = 'searchMigration1617875747202'
 
     public async up(queryRunner: QueryRunner): Promise<void> {
         // TODO: escape 

+ 2 - 2
query-node/generated/graphql-server/db/migrations/videoCategoriesByName.migration.ts

@@ -1,7 +1,7 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
-export class VideoCategoriesByNameMigration1617193983916 implements MigrationInterface {
-    name = 'videoCategoriesByNameMigration1617193983916'
+export class VideoCategoriesByNameMigration1617875747204 implements MigrationInterface {
+    name = 'videoCategoriesByNameMigration1617875747204'
 
     public async up(queryRunner: QueryRunner): Promise<void> {
         // TODO: escape 

+ 1 - 1
query-node/generated/graphql-server/package.json

@@ -1,6 +1,6 @@
 {
   "name": "query-node",
-  "version": "0.1.0",
+  "version": "0.0.0",
   "description": "Generated Warthog Project",
   "license": "MIT",
   "scripts": {

+ 3 - 6
query-node/generated/graphql-server/src/modules/channel-category/channel-category.model.ts

@@ -6,18 +6,15 @@ import { Channel } from '../channel/channel.model';
 export class ChannelCategory extends BaseModel {
   @StringField({
     nullable: true,
-    description: `The name of the category`
+    description: `The name of the category`,
   })
   name?: string;
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.category
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.category)
   channels?: Channel[];
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
   constructor(init?: Partial<ChannelCategory>) {
     super();

+ 4 - 4
query-node/generated/graphql-server/src/modules/channel-category/channel-category.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   ChannelCategoryWhereArgs,
   ChannelCategoryWhereInput,
   ChannelCategoryWhereUniqueInput,
-  ChannelCategoryOrderByEnum
+  ChannelCategoryOrderByEnum,
 } from '../../../generated';
 
 import { ChannelCategory } from './channel-category.model';
@@ -113,8 +113,8 @@ export class ChannelCategoryResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 27 - 45
query-node/generated/graphql-server/src/modules/channel/channel.model.ts

@@ -7,7 +7,7 @@ import {
   OneToMany,
   CustomField,
   EnumField,
-  StringField
+  StringField,
 } from 'warthog';
 
 import { Membership } from '../membership/membership.model';
@@ -22,107 +22,89 @@ export { AssetAvailability };
 
 @Model({ api: {} })
 export class Channel extends BaseModel {
-  @ManyToOne(
-    () => Membership,
-    (param: Membership) => param.channels,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => Membership, (param: Membership) => param.channels, { skipGraphQLField: true, nullable: true })
   ownerMember?: Membership;
 
-  @ManyToOne(
-    () => CuratorGroup,
-    (param: CuratorGroup) => param.channels,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => CuratorGroup, (param: CuratorGroup) => param.channels, { skipGraphQLField: true, nullable: true })
   ownerCuratorGroup?: CuratorGroup;
 
-  @ManyToOne(
-    () => ChannelCategory,
-    (param: ChannelCategory) => param.channels,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => ChannelCategory, (param: ChannelCategory) => param.channels, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   category?: ChannelCategory;
 
   @StringField({
     nullable: true,
-    description: `Reward account where revenue is sent if set.`
+    description: `Reward account where revenue is sent if set.`,
   })
   rewardAccount?: string;
 
   @StringField({
     nullable: true,
-    description: `The title of the Channel`
+    description: `The title of the Channel`,
   })
   title?: string;
 
   @StringField({
     nullable: true,
-    description: `The description of a Channel`
+    description: `The description of a Channel`,
   })
   description?: string;
 
-  @ManyToOne(
-    () => DataObject,
-    (param: DataObject) => param.channelcoverPhotoDataObject,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => DataObject, (param: DataObject) => param.channelcoverPhotoDataObject, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   coverPhotoDataObject?: DataObject;
 
   @CustomField({
     db: { type: 'text', array: true },
-    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` }
+    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` },
   })
   coverPhotoUrls!: string[];
 
   @EnumField('AssetAvailability', AssetAvailability, {
-    description: `Availability meta information`
+    description: `Availability meta information`,
   })
   coverPhotoAvailability!: AssetAvailability;
 
-  @ManyToOne(
-    () => DataObject,
-    (param: DataObject) => param.channelavatarDataObject,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => DataObject, (param: DataObject) => param.channelavatarDataObject, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   avatarDataObject?: DataObject;
 
   @CustomField({
     db: { type: 'text', array: true },
-    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` }
+    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` },
   })
   avatarUrls!: string[];
 
   @EnumField('AssetAvailability', AssetAvailability, {
-    description: `Availability meta information`
+    description: `Availability meta information`,
   })
   avatarAvailability!: AssetAvailability;
 
   @BooleanField({
     nullable: true,
-    description: `Flag signaling whether a channel is public.`
+    description: `Flag signaling whether a channel is public.`,
   })
   isPublic?: boolean;
 
   @BooleanField({
-    description: `Flag signaling whether a channel is censored.`
+    description: `Flag signaling whether a channel is censored.`,
   })
   isCensored!: boolean;
 
-  @ManyToOne(
-    () => Language,
-    (param: Language) => param.channellanguage,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => Language, (param: Language) => param.channellanguage, { skipGraphQLField: true, nullable: true })
   language?: Language;
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.channel
-  )
+  @OneToMany(() => Video, (param: Video) => param.channel)
   videos?: Video[];
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
   constructor(init?: Partial<Channel>) {
     super();

+ 4 - 4
query-node/generated/graphql-server/src/modules/channel/channel.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   ChannelWhereArgs,
   ChannelWhereInput,
   ChannelWhereUniqueInput,
-  ChannelOrderByEnum
+  ChannelOrderByEnum,
 } from '../../../generated';
 
 import { Channel } from './channel.model';
@@ -118,8 +118,8 @@ export class ChannelResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 3 - 6
query-node/generated/graphql-server/src/modules/curator-group/curator-group.model.ts

@@ -8,19 +8,16 @@ import { Channel } from '../channel/channel.model';
 export class CuratorGroup extends BaseModel {
   @CustomField({
     db: { type: 'numeric', array: true },
-    api: { type: 'numeric', description: `Curators belonging to this group` }
+    api: { type: 'numeric', description: `Curators belonging to this group` },
   })
   curatorIds!: BN[];
 
   @BooleanField({
-    description: `Is group active or not`
+    description: `Is group active or not`,
   })
   isActive!: boolean;
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.ownerCuratorGroup
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.ownerCuratorGroup)
   channels?: Channel[];
 
   constructor(init?: Partial<CuratorGroup>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/curator-group/curator-group.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   CuratorGroupWhereArgs,
   CuratorGroupWhereInput,
   CuratorGroupWhereUniqueInput,
-  CuratorGroupOrderByEnum
+  CuratorGroupOrderByEnum,
 } from '../../../generated';
 
 import { CuratorGroup } from './curator-group.model';
@@ -113,8 +113,8 @@ export class CuratorGroupResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 18 - 33
query-node/generated/graphql-server/src/modules/data-object/data-object.model.ts

@@ -18,18 +18,18 @@ export { LiaisonJudgement };
 export class DataObject extends BaseModel {
   @Column('jsonb')
   @WarthogField('json')
-  @Field(type => DataObjectOwner, {
-    description: `Content owner`
+  @Field((type) => DataObjectOwner, {
+    description: `Content owner`,
   })
   owner!: typeof DataObjectOwner;
 
   @IntField({
-    description: `Content added at`
+    description: `Content added at`,
   })
-  addedAt!: number;
+  createdInBlock!: number;
 
   @IntField({
-    description: `Content type id`
+    description: `Content type id`,
   })
   typeId!: number;
 
@@ -39,63 +39,48 @@ export class DataObject extends BaseModel {
     transformer: {
       to: (entityValue: BN) => (entityValue !== undefined ? entityValue.toString(10) : null),
       from: (dbValue: string) =>
-        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined
-    }
+        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined,
+    },
   })
   size!: BN;
 
   @NumericField({
+    nullable: true,
     description: `Storage provider id of the liaison`,
 
     transformer: {
       to: (entityValue: BN) => (entityValue !== undefined ? entityValue.toString(10) : null),
       from: (dbValue: string) =>
-        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined
-    }
+        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined,
+    },
   })
-  liaisonId!: BN;
+  liaisonId?: BN;
 
   @EnumField('LiaisonJudgement', LiaisonJudgement, {
-    description: `Storage provider as liaison judgment`
+    description: `Storage provider as liaison judgment`,
   })
   liaisonJudgement!: LiaisonJudgement;
 
   @StringField({
-    description: `IPFS content id`
+    description: `IPFS content id`,
   })
   ipfsContentId!: string;
 
   @StringField({
-    description: `Joystream runtime content`
+    description: `Joystream runtime content`,
   })
   joystreamContentId!: string;
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.coverPhotoDataObject,
-    { nullable: true }
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.coverPhotoDataObject, { nullable: true })
   channelcoverPhotoDataObject?: Channel[];
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.avatarDataObject,
-    { nullable: true }
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.avatarDataObject, { nullable: true })
   channelavatarDataObject?: Channel[];
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.thumbnailDataObject,
-    { nullable: true }
-  )
+  @OneToMany(() => Video, (param: Video) => param.thumbnailDataObject, { nullable: true })
   videothumbnailDataObject?: Video[];
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.mediaDataObject,
-    { nullable: true }
-  )
+  @OneToMany(() => Video, (param: Video) => param.mediaDataObject, { nullable: true })
   videomediaDataObject?: Video[];
 
   constructor(init?: Partial<DataObject>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/data-object/data-object.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   DataObjectWhereArgs,
   DataObjectWhereInput,
   DataObjectWhereUniqueInput,
-  DataObjectOrderByEnum
+  DataObjectOrderByEnum,
 } from '../../../generated';
 
 import { DataObject } from './data-object.model';
@@ -114,8 +114,8 @@ export class DataObjectResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 4 - 4
query-node/generated/graphql-server/src/modules/enums/enums.ts

@@ -1,20 +1,20 @@
 export enum Network {
   BABYLON = 'BABYLON',
   ALEXANDRIA = 'ALEXANDRIA',
-  ROME = 'ROME'
+  ROME = 'ROME',
 }
 export enum MembershipEntryMethod {
   PAID = 'PAID',
   SCREENING = 'SCREENING',
-  GENESIS = 'GENESIS'
+  GENESIS = 'GENESIS',
 }
 export enum AssetAvailability {
   ACCEPTED = 'ACCEPTED',
   PENDING = 'PENDING',
-  INVALID = 'INVALID'
+  INVALID = 'INVALID',
 }
 export enum LiaisonJudgement {
   PENDING = 'PENDING',
   ACCEPTED = 'ACCEPTED',
-  REJECTED = 'REJECTED'
+  REJECTED = 'REJECTED',
 }

+ 1 - 4
query-node/generated/graphql-server/src/modules/featured-video/featured-video.model.ts

@@ -4,10 +4,7 @@ import { Video } from '../video/video.model';
 
 @Model({ api: {} })
 export class FeaturedVideo extends BaseModel {
-  @OneToOneJoin(
-    () => Video,
-    (param: Video) => param.featured
-  )
+  @OneToOneJoin(() => Video, (param: Video) => param.featured)
   video!: Video;
 
   constructor(init?: Partial<FeaturedVideo>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/featured-video/featured-video.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   FeaturedVideoWhereArgs,
   FeaturedVideoWhereInput,
   FeaturedVideoWhereUniqueInput,
-  FeaturedVideoOrderByEnum
+  FeaturedVideoOrderByEnum,
 } from '../../../generated';
 
 import { FeaturedVideo } from './featured-video.model';
@@ -113,8 +113,8 @@ export class FeaturedVideoResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 4 - 12
query-node/generated/graphql-server/src/modules/language/language.model.ts

@@ -6,25 +6,17 @@ import { Video } from '../video/video.model';
 @Model({ api: {} })
 export class Language extends BaseModel {
   @StringField({
-    description: `Language identifier ISO 639-1`
+    description: `Language identifier ISO 639-1`,
   })
   iso!: string;
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.language,
-    { nullable: true }
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.language, { nullable: true })
   channellanguage?: Channel[];
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.language,
-    { nullable: true }
-  )
+  @OneToMany(() => Video, (param: Video) => param.language, { nullable: true })
   videolanguage?: Video[];
 
   constructor(init?: Partial<Language>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/language/language.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   LanguageWhereArgs,
   LanguageWhereInput,
   LanguageWhereUniqueInput,
-  LanguageOrderByEnum
+  LanguageOrderByEnum,
 } from '../../../generated';
 
 import { Language } from './language.model';
@@ -114,8 +114,8 @@ export class LanguageResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 4 - 8
query-node/generated/graphql-server/src/modules/license/license.model.ts

@@ -6,27 +6,23 @@ import { Video } from '../video/video.model';
 export class License extends BaseModel {
   @IntField({
     nullable: true,
-    description: `License code defined by Joystream`
+    description: `License code defined by Joystream`,
   })
   code?: number;
 
   @StringField({
     nullable: true,
-    description: `Attribution (if required by the license)`
+    description: `Attribution (if required by the license)`,
   })
   attribution?: string;
 
   @StringField({
     nullable: true,
-    description: `Custom license content`
+    description: `Custom license content`,
   })
   customText?: string;
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.license,
-    { nullable: true }
-  )
+  @OneToMany(() => Video, (param: Video) => param.license, { nullable: true })
   videolicense?: Video[];
 
   constructor(init?: Partial<License>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/license/license.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   LicenseWhereArgs,
   LicenseWhereInput,
   LicenseWhereUniqueInput,
-  LicenseOrderByEnum
+  LicenseOrderByEnum,
 } from '../../../generated';
 
 import { License } from './license.model';
@@ -113,8 +113,8 @@ export class LicenseResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 12 - 20
query-node/generated/graphql-server/src/modules/membership/membership.model.ts

@@ -1,4 +1,4 @@
-import { BaseModel, IntField, NumericField, DateTimeField, Model, OneToMany, EnumField, StringField } from 'warthog';
+import { BaseModel, IntField, NumericField, Model, OneToMany, EnumField, StringField } from 'warthog';
 
 import BN from 'bn.js';
 
@@ -11,44 +11,39 @@ export { MembershipEntryMethod };
 export class Membership extends BaseModel {
   @StringField({
     description: `The unique handle chosen by member`,
-    unique: true
+    unique: true,
   })
   handle!: string;
 
   @StringField({
     nullable: true,
-    description: `A Url to member's Avatar image`
+    description: `A Url to member's Avatar image`,
   })
   avatarUri?: string;
 
   @StringField({
     nullable: true,
-    description: `Short text chosen by member to share information about themselves`
+    description: `Short text chosen by member to share information about themselves`,
   })
   about?: string;
 
   @StringField({
-    description: `Member's controller account id`
+    description: `Member's controller account id`,
   })
   controllerAccount!: string;
 
   @StringField({
-    description: `Member's root account id`
+    description: `Member's root account id`,
   })
   rootAccount!: string;
 
   @IntField({
-    description: `Blocknumber when member was registered`
+    description: `Blocknumber when member was registered`,
   })
-  registeredAtBlock!: number;
-
-  @DateTimeField({
-    description: `Timestamp when member was registered`
-  })
-  registeredAtTime!: Date;
+  createdInBlock!: number;
 
   @EnumField('MembershipEntryMethod', MembershipEntryMethod, {
-    description: `How the member was registered`
+    description: `How the member was registered`,
   })
   entry!: MembershipEntryMethod;
 
@@ -59,15 +54,12 @@ export class Membership extends BaseModel {
     transformer: {
       to: (entityValue: BN) => (entityValue !== undefined ? entityValue.toString(10) : null),
       from: (dbValue: string) =>
-        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined
-    }
+        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined,
+    },
   })
   subscription?: BN;
 
-  @OneToMany(
-    () => Channel,
-    (param: Channel) => param.ownerMember
-  )
+  @OneToMany(() => Channel, (param: Channel) => param.ownerMember)
   channels?: Channel[];
 
   constructor(init?: Partial<Membership>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/membership/membership.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   MembershipWhereArgs,
   MembershipWhereInput,
   MembershipWhereUniqueInput,
-  MembershipOrderByEnum
+  MembershipOrderByEnum,
 } from '../../../generated';
 
 import { Membership } from './membership.model';
@@ -113,8 +113,8 @@ export class MembershipResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 11 - 12
query-node/generated/graphql-server/src/modules/variants/variants.model.ts

@@ -8,7 +8,7 @@ import {
   JSONField,
   BytesField,
   EnumField,
-  StringField
+  StringField,
 } from 'warthog';
 
 import BN from 'bn.js';
@@ -20,13 +20,13 @@ export class DataObjectOwnerChannel {
   public isTypeOf: string = 'DataObjectOwnerChannel';
 
   @NumericField({
-    description: `Channel identifier`
+    description: `Channel identifier`,
   })
   channel!: BN;
 
   @IntField({
     nullable: true,
-    description: `Variant needs to have at least one property. This value is not used.`
+    description: `Variant needs to have at least one property. This value is not used.`,
   })
   dummy?: number;
 }
@@ -36,7 +36,7 @@ export class DataObjectOwnerCouncil {
 
   @IntField({
     nullable: true,
-    description: `Variant needs to have at least one property. This value is not used.`
+    description: `Variant needs to have at least one property. This value is not used.`,
   })
   dummy?: number;
 }
@@ -45,7 +45,7 @@ export class DataObjectOwnerDao {
   public isTypeOf: string = 'DataObjectOwnerDao';
 
   @NumericField({
-    description: `DAO identifier`
+    description: `DAO identifier`,
   })
   dao!: BN;
 }
@@ -54,13 +54,13 @@ export class DataObjectOwnerMember {
   public isTypeOf: string = 'DataObjectOwnerMember';
 
   @NumericField({
-    description: `Member identifier`
+    description: `Member identifier`,
   })
   member!: BN;
 
   @IntField({
     nullable: true,
-    description: `Variant needs to have at least one property. This value is not used.`
+    description: `Variant needs to have at least one property. This value is not used.`,
   })
   dummy?: number;
 }
@@ -69,10 +69,9 @@ export class DataObjectOwnerWorkingGroup {
   public isTypeOf: string = 'DataObjectOwnerWorkingGroup';
 
   @IntField({
-    nullable: true,
-    description: `Variant needs to have at least one property. This value is not used.`
+    description: `Working group identifier`,
   })
-  dummy?: number;
+  workingGroup!: number;
 }
 
 export const DataObjectOwner = createUnionType({
@@ -82,7 +81,7 @@ export const DataObjectOwner = createUnionType({
     DataObjectOwnerChannel,
     DataObjectOwnerDao,
     DataObjectOwnerCouncil,
-    DataObjectOwnerWorkingGroup
+    DataObjectOwnerWorkingGroup,
   ],
-  resolveType: value => (value.isTypeOf ? value.isTypeOf : undefined)
+  resolveType: (value) => (value.isTypeOf ? value.isTypeOf : undefined),
 });

+ 3 - 6
query-node/generated/graphql-server/src/modules/video-category/video-category.model.ts

@@ -6,18 +6,15 @@ import { Video } from '../video/video.model';
 export class VideoCategory extends BaseModel {
   @StringField({
     nullable: true,
-    description: `The name of the category`
+    description: `The name of the category`,
   })
   name?: string;
 
-  @OneToMany(
-    () => Video,
-    (param: Video) => param.category
-  )
+  @OneToMany(() => Video, (param: Video) => param.category)
   videos?: Video[];
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
   constructor(init?: Partial<VideoCategory>) {
     super();

+ 4 - 4
query-node/generated/graphql-server/src/modules/video-category/video-category.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   VideoCategoryWhereArgs,
   VideoCategoryWhereInput,
   VideoCategoryWhereUniqueInput,
-  VideoCategoryOrderByEnum
+  VideoCategoryOrderByEnum,
 } from '../../../generated';
 
 import { VideoCategory } from './video-category.model';
@@ -113,8 +113,8 @@ export class VideoCategoryResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 4 - 8
query-node/generated/graphql-server/src/modules/video-media-encoding/video-media-encoding.model.ts

@@ -6,27 +6,23 @@ import { VideoMediaMetadata } from '../video-media-metadata/video-media-metadata
 export class VideoMediaEncoding extends BaseModel {
   @StringField({
     nullable: true,
-    description: `Encoding of the video media object`
+    description: `Encoding of the video media object`,
   })
   codecName?: string;
 
   @StringField({
     nullable: true,
-    description: `Media container format`
+    description: `Media container format`,
   })
   container?: string;
 
   @StringField({
     nullable: true,
-    description: `Content MIME type`
+    description: `Content MIME type`,
   })
   mimeMediaType?: string;
 
-  @OneToMany(
-    () => VideoMediaMetadata,
-    (param: VideoMediaMetadata) => param.encoding,
-    { nullable: true }
-  )
+  @OneToMany(() => VideoMediaMetadata, (param: VideoMediaMetadata) => param.encoding, { nullable: true })
   videomediametadataencoding?: VideoMediaMetadata[];
 
   constructor(init?: Partial<VideoMediaEncoding>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/video-media-encoding/video-media-encoding.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   VideoMediaEncodingWhereArgs,
   VideoMediaEncodingWhereInput,
   VideoMediaEncodingWhereUniqueInput,
-  VideoMediaEncodingOrderByEnum
+  VideoMediaEncodingOrderByEnum,
 } from '../../../generated';
 
 import { VideoMediaEncoding } from './video-media-encoding.model';
@@ -113,8 +113,8 @@ export class VideoMediaEncodingResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 10 - 15
query-node/generated/graphql-server/src/modules/video-media-metadata/video-media-metadata.model.ts

@@ -7,22 +7,21 @@ import { Video } from '../video/video.model';
 
 @Model({ api: {} })
 export class VideoMediaMetadata extends BaseModel {
-  @ManyToOne(
-    () => VideoMediaEncoding,
-    (param: VideoMediaEncoding) => param.videomediametadataencoding,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => VideoMediaEncoding, (param: VideoMediaEncoding) => param.videomediametadataencoding, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   encoding?: VideoMediaEncoding;
 
   @IntField({
     nullable: true,
-    description: `Video media width in pixels`
+    description: `Video media width in pixels`,
   })
   pixelWidth?: number;
 
   @IntField({
     nullable: true,
-    description: `Video media height in pixels`
+    description: `Video media height in pixels`,
   })
   pixelHeight?: number;
 
@@ -33,20 +32,16 @@ export class VideoMediaMetadata extends BaseModel {
     transformer: {
       to: (entityValue: BN) => (entityValue !== undefined ? entityValue.toString(10) : null),
       from: (dbValue: string) =>
-        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined
-    }
+        dbValue !== undefined && dbValue !== null && dbValue.length > 0 ? new BN(dbValue, 10) : undefined,
+    },
   })
   size?: BN;
 
-  @OneToOne(
-    () => Video,
-    (param: Video) => param.mediaMetadata,
-    { nullable: true }
-  )
+  @OneToOne(() => Video, (param: Video) => param.mediaMetadata, { nullable: true })
   video?: Video;
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
   constructor(init?: Partial<VideoMediaMetadata>) {
     super();

+ 4 - 4
query-node/generated/graphql-server/src/modules/video-media-metadata/video-media-metadata.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   VideoMediaMetadataWhereArgs,
   VideoMediaMetadataWhereInput,
   VideoMediaMetadataWhereUniqueInput,
-  VideoMediaMetadataOrderByEnum
+  VideoMediaMetadataOrderByEnum,
 } from '../../../generated';
 
 import { VideoMediaMetadata } from './video-media-metadata.model';
@@ -114,8 +114,8 @@ export class VideoMediaMetadataResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 29 - 56
query-node/generated/graphql-server/src/modules/video/video.model.ts

@@ -9,7 +9,7 @@ import {
   OneToOneJoin,
   CustomField,
   EnumField,
-  StringField
+  StringField,
 } from 'warthog';
 
 import { Channel } from '../channel/channel.model';
@@ -21,141 +21,114 @@ import { VideoMediaMetadata } from '../video-media-metadata/video-media-metadata
 import { FeaturedVideo } from '../featured-video/featured-video.model';
 
 import { AssetAvailability } from '../enums/enums';
-export { AssetAvailability };
 
 @Model({ api: {} })
 export class Video extends BaseModel {
-  @ManyToOne(
-    () => Channel,
-    (param: Channel) => param.videos,
-    { skipGraphQLField: true }
-  )
+  @ManyToOne(() => Channel, (param: Channel) => param.videos, { skipGraphQLField: true })
   channel!: Channel;
 
-  @ManyToOne(
-    () => VideoCategory,
-    (param: VideoCategory) => param.videos,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => VideoCategory, (param: VideoCategory) => param.videos, { skipGraphQLField: true, nullable: true })
   category?: VideoCategory;
 
   @StringField({
     nullable: true,
-    description: `The title of the video`
+    description: `The title of the video`,
   })
   title?: string;
 
   @StringField({
     nullable: true,
-    description: `The description of the Video`
+    description: `The description of the Video`,
   })
   description?: string;
 
   @IntField({
     nullable: true,
-    description: `Video duration in seconds`
+    description: `Video duration in seconds`,
   })
   duration?: number;
 
-  @ManyToOne(
-    () => DataObject,
-    (param: DataObject) => param.videothumbnailDataObject,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => DataObject, (param: DataObject) => param.videothumbnailDataObject, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   thumbnailDataObject?: DataObject;
 
   @CustomField({
     db: { type: 'text', array: true },
-    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` }
+    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` },
   })
   thumbnailUrls!: string[];
 
   @EnumField('AssetAvailability', AssetAvailability, {
-    description: `Availability meta information`
+    description: `Availability meta information`,
   })
   thumbnailAvailability!: AssetAvailability;
 
-  @ManyToOne(
-    () => Language,
-    (param: Language) => param.videolanguage,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => Language, (param: Language) => param.videolanguage, { skipGraphQLField: true, nullable: true })
   language?: Language;
 
   @BooleanField({
     nullable: true,
-    description: `Whether or not Video contains marketing`
+    description: `Whether or not Video contains marketing`,
   })
   hasMarketing?: boolean;
 
   @DateTimeField({
     nullable: true,
-    description: `If the Video was published on other platform before beeing published on Joystream - the original publication date`
+    description: `If the Video was published on other platform before beeing published on Joystream - the original publication date`,
   })
   publishedBeforeJoystream?: Date;
 
   @BooleanField({
     nullable: true,
-    description: `Whether the Video is supposed to be publically displayed`
+    description: `Whether the Video is supposed to be publically displayed`,
   })
   isPublic?: boolean;
 
   @BooleanField({
-    description: `Flag signaling whether a video is censored.`
+    description: `Flag signaling whether a video is censored.`,
   })
   isCensored!: boolean;
 
   @BooleanField({
     nullable: true,
-    description: `Whether the Video contains explicit material.`
+    description: `Whether the Video contains explicit material.`,
   })
   isExplicit?: boolean;
 
-  @ManyToOne(
-    () => License,
-    (param: License) => param.videolicense,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => License, (param: License) => param.videolicense, { skipGraphQLField: true, nullable: true })
   license?: License;
 
-  @ManyToOne(
-    () => DataObject,
-    (param: DataObject) => param.videomediaDataObject,
-    { skipGraphQLField: true, nullable: true }
-  )
+  @ManyToOne(() => DataObject, (param: DataObject) => param.videomediaDataObject, {
+    skipGraphQLField: true,
+    nullable: true,
+  })
   mediaDataObject?: DataObject;
 
   @CustomField({
     db: { type: 'text', array: true },
-    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` }
+    api: { type: 'string', description: `URLs where the asset content can be accessed (if any)` },
   })
   mediaUrls!: string[];
 
   @EnumField('AssetAvailability', AssetAvailability, {
-    description: `Availability meta information`
+    description: `Availability meta information`,
   })
   mediaAvailability!: AssetAvailability;
 
-  @OneToOneJoin(
-    () => VideoMediaMetadata,
-    (param: VideoMediaMetadata) => param.video,
-    { nullable: true }
-  )
+  @OneToOneJoin(() => VideoMediaMetadata, (param: VideoMediaMetadata) => param.video, { nullable: true })
   mediaMetadata?: VideoMediaMetadata;
 
   @IntField({})
-  happenedIn!: number;
+  createdInBlock!: number;
 
   @BooleanField({
-    description: `Is video featured or not`
+    description: `Is video featured or not`,
   })
   isFeatured!: boolean;
 
-  @OneToOne(
-    () => FeaturedVideo,
-    (param: FeaturedVideo) => param.video,
-    { nullable: true }
-  )
+  @OneToOne(() => FeaturedVideo, (param: FeaturedVideo) => param.video, { nullable: true })
   featured?: FeaturedVideo;
 
   constructor(init?: Partial<Video>) {

+ 4 - 4
query-node/generated/graphql-server/src/modules/video/video.resolver.ts

@@ -10,7 +10,7 @@ import {
   Field,
   Int,
   ArgsType,
-  Info
+  Info,
 } from 'type-graphql';
 import graphqlFields from 'graphql-fields';
 import { Inject } from 'typedi';
@@ -24,7 +24,7 @@ import {
   VideoWhereArgs,
   VideoWhereInput,
   VideoWhereUniqueInput,
-  VideoOrderByEnum
+  VideoOrderByEnum,
 } from '../../../generated';
 
 import { Video } from './video.model';
@@ -119,8 +119,8 @@ export class VideoResolver {
       edges: [],
       pageInfo: {
         hasNextPage: false,
-        hasPreviousPage: false
-      }
+        hasPreviousPage: false,
+      },
     };
     // If the related database table does not have any records then an error is thrown to the client
     // by warthog

+ 1 - 1
query-node/mappings/src/common.ts

@@ -42,7 +42,7 @@ export async function prepareDataObject(
 ): Promise<DataObject> {
   const dataObject = new DataObject({
     owner,
-    addedAt: blockNumber,
+    createdInBlock: blockNumber,
     typeId: contentParameters.type_id.toNumber(),
     // `size` is masked by `size` special name in `Struct` so there needs to be `.get('size') as unknown as u64` to retrieve proper value
     size: (contentParameters.get('size') as unknown as u64).toBn(),

+ 2 - 2
query-node/mappings/src/content/video.ts

@@ -56,7 +56,7 @@ export async function content_VideoCategoryCreated(
     id: videoCategoryId.toString(), // ChannelId
     isCensored: false,
     videos: [],
-    happenedIn: event.blockNumber,
+    createdInBlock: event.blockNumber,
     ...Object(protobufContent)
   })
 
@@ -164,7 +164,7 @@ export async function content_VideoCreated(
     id: videoId,
     isCensored: false,
     channel: channelId,
-    happenedIn: event.blockNumber,
+    createdInBlock: event.blockNumber,
     ...Object(protobufContent)
   })
 

+ 1 - 2
query-node/mappings/src/membership.ts

@@ -50,8 +50,7 @@ export async function members_MemberRegistered(db: DatabaseManager, event_: Subs
     handle: convertBytesToString(handle.unwrapOr(null)),
     about: convertBytesToString(about.unwrapOr(null)),
     avatarUri: convertBytesToString(avatarUri.unwrapOr(null)),
-    registeredAtBlock: event_.blockNumber,
-    registeredAtTime: new Date(event_.blockTimestamp.toNumber()),
+    createdInBlock: event_.blockNumber,
     // TODO: in the runtime there is currently no way to distinguish distinguish `buy_membership`(method `Paid`) and `add_screened_member`(`Screening`)
     entry: MembershipEntryMethod.PAID,
   })

+ 8 - 11
query-node/schema.graphql

@@ -31,10 +31,7 @@ type Membership @entity {
   rootAccount: String!
 
   "Blocknumber when member was registered"
-  registeredAtBlock: Int!
-
-  "Timestamp when member was registered"
-  registeredAtTime: DateTime!
+  createdInBlock: Int!
 
   "How the member was registered"
   entry: MembershipEntryMethod!
@@ -54,7 +51,7 @@ type ChannelCategory @entity {
 
   channels: [Channel!]! @derivedFrom(field: "category")
 
-  happenedIn: Int!
+  createdInBlock: Int!
 }
 
 "Asset availability representation"
@@ -87,7 +84,7 @@ type DataObject @entity {
   owner: DataObjectOwner!
 
   "Content added at"
-  addedAt: Int!
+  createdInBlock: Int!
 
   "Content type id"
   typeId: Int!
@@ -167,7 +164,7 @@ type Language @entity {
   "Language identifier ISO 639-1"
   iso: String!
 
-  happenedIn: Int!
+  createdInBlock: Int!
 }
 
 type Channel @entity {
@@ -230,7 +227,7 @@ type Channel @entity {
 
   videos: [Video!]! @derivedFrom(field: "channel")
 
-  happenedIn: Int!
+  createdInBlock: Int!
 }
 
 type CuratorGroup @entity {
@@ -255,7 +252,7 @@ type VideoCategory @entity {
 
   videos: [Video!]! @derivedFrom(field: "category")
 
-  happenedIn: Int!
+  createdInBlock: Int!
 }
 
 type Video @entity {
@@ -331,7 +328,7 @@ type Video @entity {
   "Video file metadata"
   mediaMetadata: VideoMediaMetadata
 
-  happenedIn: Int!
+  createdInBlock: Int!
 
   "Is video featured or not"
   isFeatured: Boolean!
@@ -357,7 +354,7 @@ type VideoMediaMetadata @entity {
 
   video: Video @derivedFrom(field: "mediaMetadata")
 
-  happenedIn: Int!
+  createdInBlock: Int!
 }
 
 type VideoMediaEncoding @entity {