graph

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type AftermarketDeviceEarningsResolver added in v0.1.9

type AftermarketDeviceEarningsResolver interface {
	History(ctx context.Context, obj *model.AftermarketDeviceEarnings, first *int, after *string, last *int, before *string) (*model.EarningsConnection, error)
}

type AftermarketDeviceRepository added in v0.1.20

type AftermarketDeviceRepository interface {
	GetAftermarketDevices(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) (*model.AftermarketDeviceConnection, error)
	GetAftermarketDevice(ctx context.Context, by model.AftermarketDeviceBy) (*model.AftermarketDevice, error)
	GetAftermarketDevicesForManufacturer(ctx context.Context, obj *model.Manufacturer, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) (*model.AftermarketDeviceConnection, error)
}

AftermarketDeviceRepository interface for mocking aftermarket.Repository.

type AftermarketDeviceResolver

type AftermarketDeviceResolver interface {
	Manufacturer(ctx context.Context, obj *model.AftermarketDevice) (*model.Manufacturer, error)

	Vehicle(ctx context.Context, obj *model.AftermarketDevice) (*model.Vehicle, error)

	Earnings(ctx context.Context, obj *model.AftermarketDevice) (*model.AftermarketDeviceEarnings, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	AftermarketDevice struct {
		Address          func(childComplexity int) int
		Beneficiary      func(childComplexity int) int
		ClaimedAt        func(childComplexity int) int
		DevEui           func(childComplexity int) int
		Earnings         func(childComplexity int) int
		HardwareRevision func(childComplexity int) int
		ID               func(childComplexity int) int
		Image            func(childComplexity int) int
		Imei             func(childComplexity int) int
		Manufacturer     func(childComplexity int) int
		MintedAt         func(childComplexity int) int
		Name             func(childComplexity int) int
		Owner            func(childComplexity int) int
		PairedAt         func(childComplexity int) int
		Serial           func(childComplexity int) int
		TokenID          func(childComplexity int) int
		Vehicle          func(childComplexity int) int
	}

	AftermarketDeviceConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	AftermarketDeviceEarnings struct {
		History     func(childComplexity int, first *int, after *string, last *int, before *string) int
		TotalTokens func(childComplexity int) int
	}

	AftermarketDeviceEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	DCN struct {
		ExpiresAt func(childComplexity int) int
		ID        func(childComplexity int) int
		MintedAt  func(childComplexity int) int
		Name      func(childComplexity int) int
		Node      func(childComplexity int) int
		Owner     func(childComplexity int) int
		TokenID   func(childComplexity int) int
		Vehicle   func(childComplexity int) int
	}

	DCNConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	DCNEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Definition struct {
		ID    func(childComplexity int) int
		Make  func(childComplexity int) int
		Model func(childComplexity int) int
		Year  func(childComplexity int) int
	}

	DeveloperLicense struct {
		Alias        func(childComplexity int) int
		ClientID     func(childComplexity int) int
		MintedAt     func(childComplexity int) int
		Owner        func(childComplexity int) int
		RedirectURIs func(childComplexity int, first *int, after *string, last *int, before *string) int
		Signers      func(childComplexity int, first *int, after *string, last *int, before *string) int
		TokenID      func(childComplexity int) int
	}

	DeveloperLicenseConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	DeveloperLicenseEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	DeviceDefinition struct {
		Attributes         func(childComplexity int) int
		DeviceDefinitionID func(childComplexity int) int
		DeviceType         func(childComplexity int) int
		ImageURI           func(childComplexity int) int
		LegacyID           func(childComplexity int) int
		Manufacturer       func(childComplexity int) int
		Model              func(childComplexity int) int
		Year               func(childComplexity int) int
	}

	DeviceDefinitionAttribute struct {
		Name  func(childComplexity int) int
		Value func(childComplexity int) int
	}

	DeviceDefinitionConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	DeviceDefinitionEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Earning struct {
		AftermarketDevice       func(childComplexity int) int
		AftermarketDeviceTokens func(childComplexity int) int
		Beneficiary             func(childComplexity int) int
		ConnectionStreak        func(childComplexity int) int
		SentAt                  func(childComplexity int) int
		StreakTokens            func(childComplexity int) int
		SyntheticDevice         func(childComplexity int) int
		SyntheticDeviceTokens   func(childComplexity int) int
		Vehicle                 func(childComplexity int) int
		Week                    func(childComplexity int) int
	}

	EarningsConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	EarningsEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Manufacturer struct {
		AftermarketDevices func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) int
		DeviceDefinitions  func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.DeviceDefinitionFilter) int
		ID                 func(childComplexity int) int
		MintedAt           func(childComplexity int) int
		Name               func(childComplexity int) int
		Owner              func(childComplexity int) int
		TableID            func(childComplexity int) int
		TokenID            func(childComplexity int) int
	}

	PageInfo struct {
		EndCursor       func(childComplexity int) int
		HasNextPage     func(childComplexity int) int
		HasPreviousPage func(childComplexity int) int
		StartCursor     func(childComplexity int) int
	}

	Privilege struct {
		ExpiresAt func(childComplexity int) int
		ID        func(childComplexity int) int
		SetAt     func(childComplexity int) int
		User      func(childComplexity int) int
	}

	PrivilegeEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	PrivilegesConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	Query struct {
		AftermarketDevice  func(childComplexity int, by model.AftermarketDeviceBy) int
		AftermarketDevices func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) int
		Dcn                func(childComplexity int, by model.DCNBy) int
		Dcns               func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.DCNFilter) int
		DeveloperLicense   func(childComplexity int, by model.DeveloperLicenseBy) int
		DeveloperLicenses  func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.DeveloperLicenseFilterBy) int
		DeviceDefinition   func(childComplexity int, by model.DeviceDefinitionBy) int
		Manufacturer       func(childComplexity int, by model.ManufacturerBy) int
		Node               func(childComplexity int, id string) int
		Rewards            func(childComplexity int, user common.Address) int
		SyntheticDevice    func(childComplexity int, by model.SyntheticDeviceBy) int
		SyntheticDevices   func(childComplexity int, first *int, last *int, after *string, before *string, filterBy *model.SyntheticDevicesFilter) int
		Vehicle            func(childComplexity int, tokenID int) int
		Vehicles           func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.VehiclesFilter) int
	}

	RedirectURI struct {
		EnabledAt func(childComplexity int) int
		URI       func(childComplexity int) int
	}

	RedirectURIConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	RedirectURIEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Sacd struct {
		CreatedAt   func(childComplexity int) int
		ExpiresAt   func(childComplexity int) int
		Grantee     func(childComplexity int) int
		Permissions func(childComplexity int) int
		Source      func(childComplexity int) int
	}

	SacdConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	SacdEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Signer struct {
		Address   func(childComplexity int) int
		EnabledAt func(childComplexity int) int
	}

	SignerConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	SignerEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	SyntheticDevice struct {
		Address       func(childComplexity int) int
		ID            func(childComplexity int) int
		IntegrationID func(childComplexity int) int
		MintedAt      func(childComplexity int) int
		Name          func(childComplexity int) int
		TokenID       func(childComplexity int) int
		Vehicle       func(childComplexity int) int
	}

	SyntheticDeviceConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	SyntheticDeviceEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	UserRewards struct {
		History     func(childComplexity int, first *int, after *string, last *int, before *string) int
		TotalTokens func(childComplexity int) int
	}

	Vehicle struct {
		AftermarketDevice func(childComplexity int) int
		DataURI           func(childComplexity int) int
		Dcn               func(childComplexity int) int
		Definition        func(childComplexity int) int
		Earnings          func(childComplexity int) int
		ID                func(childComplexity int) int
		Image             func(childComplexity int) int
		ImageURI          func(childComplexity int) int
		Manufacturer      func(childComplexity int) int
		MintedAt          func(childComplexity int) int
		Name              func(childComplexity int) int
		Owner             func(childComplexity int) int
		Privileges        func(childComplexity int, first *int, after *string, last *int, before *string, filterBy *model.PrivilegeFilterBy) int
		Sacds             func(childComplexity int, first *int, after *string, last *int, before *string) int
		SyntheticDevice   func(childComplexity int) int
		TokenID           func(childComplexity int) int
	}

	VehicleConnection struct {
		Edges      func(childComplexity int) int
		Nodes      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	VehicleEarnings struct {
		History     func(childComplexity int, first *int, after *string, last *int, before *string) int
		TotalTokens func(childComplexity int) int
	}

	VehicleEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DCNRepository added in v0.1.20

type DCNRepository interface {
	GetDCN(ctx context.Context, by model.DCNBy) (*model.Dcn, error)
	GetDCNByNode(ctx context.Context, node []byte) (*model.Dcn, error)
	GetDCNByName(ctx context.Context, name string) (*model.Dcn, error)
	GetDCNs(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.DCNFilter) (*model.DCNConnection, error)
}

DCNRepository interface for mocking dcn.Repository.

type DCNResolver

type DCNResolver interface {
	Vehicle(ctx context.Context, obj *model.Dcn) (*model.Vehicle, error)
}

type DeveloperLicenseRepository added in v0.3.0

type DeveloperLicenseRepository interface {
	GetDeveloperLicenses(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.DeveloperLicenseFilterBy) (*model.DeveloperLicenseConnection, error)
	GetSignersForLicense(ctx context.Context, obj *model.DeveloperLicense, first *int, after *string, last *int, before *string) (*model.SignerConnection, error)
	GetRedirectURIsForLicense(ctx context.Context, obj *model.DeveloperLicense, first *int, after *string, last *int, before *string) (*model.RedirectURIConnection, error)

	GetLicense(ctx context.Context, by model.DeveloperLicenseBy) (*model.DeveloperLicense, error)
}

DeveloperLicenseRepository interface for mocking devicedefinition.Repository.

type DeveloperLicenseResolver added in v0.3.0

type DeveloperLicenseResolver interface {
	Signers(ctx context.Context, obj *model.DeveloperLicense, first *int, after *string, last *int, before *string) (*model.SignerConnection, error)
	RedirectURIs(ctx context.Context, obj *model.DeveloperLicense, first *int, after *string, last *int, before *string) (*model.RedirectURIConnection, error)
}

type DeviceDefinitionRepository added in v0.1.26

type DeviceDefinitionRepository interface {
	GetDeviceDefinition(ctx context.Context, by model.DeviceDefinitionBy) (*model.DeviceDefinition, error)
	GetDeviceDefinitions(ctx context.Context, tableID, first *int, after *string, last *int, before *string, filterBy *model.DeviceDefinitionFilter) (*model.DeviceDefinitionConnection, error)
}

DeviceDefinitionRepository interface for mocking devicedefinition.Repository.

type DirectiveRoot

type DirectiveRoot struct {
	OneOf func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
}

type EarningResolver added in v0.1.7

type EarningResolver interface {
	AftermarketDevice(ctx context.Context, obj *model.Earning) (*model.AftermarketDevice, error)

	SyntheticDevice(ctx context.Context, obj *model.Earning) (*model.SyntheticDevice, error)

	Vehicle(ctx context.Context, obj *model.Earning) (*model.Vehicle, error)
}

type ManufacturerRepository added in v0.1.20

type ManufacturerRepository interface {
	GetManufacturer(ctx context.Context, by model.ManufacturerBy) (*model.Manufacturer, error)
}

ManufacturerRepository interface for mocking manufacturer.Repository.

type ManufacturerResolver added in v0.1.14

type ManufacturerResolver interface {
	AftermarketDevices(ctx context.Context, obj *model.Manufacturer, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) (*model.AftermarketDeviceConnection, error)
	DeviceDefinitions(ctx context.Context, obj *model.Manufacturer, first *int, after *string, last *int, before *string, filterBy *model.DeviceDefinitionFilter) (*model.DeviceDefinitionConnection, error)
}

type QueryResolver

type QueryResolver interface {
	Node(ctx context.Context, id string) (model.Node, error)
	AftermarketDevice(ctx context.Context, by model.AftermarketDeviceBy) (*model.AftermarketDevice, error)
	AftermarketDevices(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.AftermarketDevicesFilter) (*model.AftermarketDeviceConnection, error)
	Dcn(ctx context.Context, by model.DCNBy) (*model.Dcn, error)
	Dcns(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.DCNFilter) (*model.DCNConnection, error)
	DeveloperLicenses(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.DeveloperLicenseFilterBy) (*model.DeveloperLicenseConnection, error)
	DeveloperLicense(ctx context.Context, by model.DeveloperLicenseBy) (*model.DeveloperLicense, error)
	DeviceDefinition(ctx context.Context, by model.DeviceDefinitionBy) (*model.DeviceDefinition, error)
	Manufacturer(ctx context.Context, by model.ManufacturerBy) (*model.Manufacturer, error)
	Rewards(ctx context.Context, user common.Address) (*model.UserRewards, error)
	SyntheticDevice(ctx context.Context, by model.SyntheticDeviceBy) (*model.SyntheticDevice, error)
	SyntheticDevices(ctx context.Context, first *int, last *int, after *string, before *string, filterBy *model.SyntheticDevicesFilter) (*model.SyntheticDeviceConnection, error)
	Vehicle(ctx context.Context, tokenID int) (*model.Vehicle, error)
	Vehicles(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.VehiclesFilter) (*model.VehicleConnection, error)
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver holds the repositories for the graph resolvers.

func NewResolver

func NewResolver(baseRepo *base.Repository) *Resolver

NewResolver creates a new Resolver with allocated repositories.

func (*Resolver) AftermarketDevice

func (r *Resolver) AftermarketDevice() AftermarketDeviceResolver

AftermarketDevice returns AftermarketDeviceResolver implementation.

func (*Resolver) AftermarketDeviceEarnings added in v0.1.9

func (r *Resolver) AftermarketDeviceEarnings() AftermarketDeviceEarningsResolver

AftermarketDeviceEarnings returns AftermarketDeviceEarningsResolver implementation.

func (*Resolver) DCN

func (r *Resolver) DCN() DCNResolver

DCN returns DCNResolver implementation.

func (*Resolver) DeveloperLicense added in v0.3.0

func (r *Resolver) DeveloperLicense() DeveloperLicenseResolver

DeveloperLicense returns DeveloperLicenseResolver implementation.

func (*Resolver) Earning added in v0.1.7

func (r *Resolver) Earning() EarningResolver

Earning returns EarningResolver implementation.

func (*Resolver) Manufacturer added in v0.1.14

func (r *Resolver) Manufacturer() ManufacturerResolver

Manufacturer returns ManufacturerResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

func (*Resolver) SyntheticDevice added in v0.1.30

func (r *Resolver) SyntheticDevice() SyntheticDeviceResolver

SyntheticDevice returns SyntheticDeviceResolver implementation.

func (*Resolver) UserRewards added in v0.1.10

func (r *Resolver) UserRewards() UserRewardsResolver

UserRewards returns UserRewardsResolver implementation.

func (*Resolver) Vehicle

func (r *Resolver) Vehicle() VehicleResolver

Vehicle returns VehicleResolver implementation.

func (*Resolver) VehicleEarnings added in v0.1.7

func (r *Resolver) VehicleEarnings() VehicleEarningsResolver

VehicleEarnings returns VehicleEarningsResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	AftermarketDevice() AftermarketDeviceResolver
	AftermarketDeviceEarnings() AftermarketDeviceEarningsResolver
	DCN() DCNResolver
	DeveloperLicense() DeveloperLicenseResolver
	Earning() EarningResolver
	Manufacturer() ManufacturerResolver
	Query() QueryResolver
	SyntheticDevice() SyntheticDeviceResolver
	UserRewards() UserRewardsResolver
	Vehicle() VehicleResolver
	VehicleEarnings() VehicleEarningsResolver
}

type SyntheticDeviceResolver added in v0.1.30

type SyntheticDeviceResolver interface {
	Vehicle(ctx context.Context, obj *model.SyntheticDevice) (*model.Vehicle, error)
}

type SyntheticRepository added in v0.1.20

type SyntheticRepository interface {
	GetSyntheticDevice(ctx context.Context, by model.SyntheticDeviceBy) (*model.SyntheticDevice, error)
	GetSyntheticDevices(ctx context.Context, first *int, last *int, after *string, before *string, filterBy *model.SyntheticDevicesFilter) (*model.SyntheticDeviceConnection, error)
}

SyntheticRepository interface for mocking synthetic.Repository.

type UserRewardsResolver added in v0.1.10

type UserRewardsResolver interface {
	History(ctx context.Context, obj *model.UserRewards, first *int, after *string, last *int, before *string) (*model.EarningsConnection, error)
}

type VehicleEarningsResolver added in v0.1.7

type VehicleEarningsResolver interface {
	History(ctx context.Context, obj *model.VehicleEarnings, first *int, after *string, last *int, before *string) (*model.EarningsConnection, error)
}

type VehicleRepository added in v0.1.20

type VehicleRepository interface {
	GetVehicles(ctx context.Context, first *int, after *string, last *int, before *string, filterBy *model.VehiclesFilter) (*model.VehicleConnection, error)
	GetVehicle(ctx context.Context, id int) (*model.Vehicle, error)
}

VehicleRepository interface for mocking vehicle.Repository.

type VehicleResolver

type VehicleResolver interface {
	Manufacturer(ctx context.Context, obj *model.Vehicle) (*model.Manufacturer, error)

	AftermarketDevice(ctx context.Context, obj *model.Vehicle) (*model.AftermarketDevice, error)
	Privileges(ctx context.Context, obj *model.Vehicle, first *int, after *string, last *int, before *string, filterBy *model.PrivilegeFilterBy) (*model.PrivilegesConnection, error)
	Sacds(ctx context.Context, obj *model.Vehicle, first *int, after *string, last *int, before *string) (*model.SacdConnection, error)
	SyntheticDevice(ctx context.Context, obj *model.Vehicle) (*model.SyntheticDevice, error)

	Dcn(ctx context.Context, obj *model.Vehicle) (*model.Dcn, error)

	Earnings(ctx context.Context, obj *model.Vehicle) (*model.VehicleEarnings, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL