Documentation
¶
Index ¶
- type Client
- func (c *Client) Execute(ctx context.Context, query string, variables map[string]interface{}) (*Response, error)
- func (c *Client) ExecuteWithResult(ctx context.Context, query string, variables map[string]interface{}, ...) error
- func (c *Client) GetFrame(ctx context.Context, fileKey, frameID string) (*Frame, error)
- func (c *Client) GetFrameTestCases(ctx context.Context, fileKey, frameID string) ([]FrameTestCase, error)
- func (c *Client) GetMorpheusUserByEmail(ctx context.Context, email string) (*MorpheusUser, error)
- func (c *Client) InsertDesignItemRevs(ctx context.Context, revs []map[string]interface{}) (int, error)
- func (c *Client) InsertFrameTestcase(ctx context.Context, testcasableID int, content interface{}) (*FrameTestCase, error)
- func (c *Client) ListDesignItemsByNodeLinkIds(ctx context.Context, fileKey, frameID string, nodeLinkIds []string) ([]DesignItem, error)
- func (c *Client) ListFramesByFrameLinkIds(ctx context.Context, fileKey string, frameLinkIds []string) ([]FrameBasic, error)
- func (c *Client) UpdateFrameTestcase(ctx context.Context, id int, content interface{}) (*FrameTestCase, error)
- func (c *Client) UpsertDesignItemSpecs(ctx context.Context, items []map[string]interface{}) ([]DesignItem, error)
- type DesignItem
- type Error
- type Frame
- type FrameBasic
- type FrameTestCase
- type MorpheusUser
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a GraphQL client for MoMorph API
func (*Client) Execute ¶
func (c *Client) Execute(ctx context.Context, query string, variables map[string]interface{}) (*Response, error)
Execute executes a GraphQL query or mutation
func (*Client) ExecuteWithResult ¶
func (c *Client) ExecuteWithResult(ctx context.Context, query string, variables map[string]interface{}, result interface{}) error
ExecuteWithResult executes a GraphQL query and unmarshals the result
func (*Client) GetFrameTestCases ¶
func (c *Client) GetFrameTestCases(ctx context.Context, fileKey, frameID string) ([]FrameTestCase, error)
GetFrameTestCases fetches test cases for a frame
func (*Client) GetMorpheusUserByEmail ¶
GetMorpheusUserByEmail fetches a user by email
func (*Client) InsertDesignItemRevs ¶
func (c *Client) InsertDesignItemRevs(ctx context.Context, revs []map[string]interface{}) (int, error)
InsertDesignItemRevs inserts design item revisions
func (*Client) InsertFrameTestcase ¶
func (c *Client) InsertFrameTestcase(ctx context.Context, testcasableID int, content interface{}) (*FrameTestCase, error)
InsertFrameTestcase creates a new test case for a frame
func (*Client) ListDesignItemsByNodeLinkIds ¶
func (c *Client) ListDesignItemsByNodeLinkIds(ctx context.Context, fileKey, frameID string, nodeLinkIds []string) ([]DesignItem, error)
ListDesignItemsByNodeLinkIds fetches design items by node link IDs
func (*Client) ListFramesByFrameLinkIds ¶
func (c *Client) ListFramesByFrameLinkIds(ctx context.Context, fileKey string, frameLinkIds []string) ([]FrameBasic, error)
ListFramesByFrameLinkIds fetches frames by their frame link IDs
func (*Client) UpdateFrameTestcase ¶
func (c *Client) UpdateFrameTestcase(ctx context.Context, id int, content interface{}) (*FrameTestCase, error)
UpdateFrameTestcase updates an existing test case
func (*Client) UpsertDesignItemSpecs ¶
func (c *Client) UpsertDesignItemSpecs(ctx context.Context, items []map[string]interface{}) ([]DesignItem, error)
UpsertDesignItemSpecs upserts multiple design item specs
type DesignItem ¶
type DesignItem struct {
ID int `json:"id"`
No string `json:"no"`
Name string `json:"name"`
Type string `json:"type"`
NodeLinkID string `json:"node_link_id"`
SectionLinkID string `json:"section_link_id"`
FrameID int `json:"frame_id"`
Status string `json:"status"`
Specs json.RawMessage `json:"specs"`
IsReviewed bool `json:"is_reviewed"`
}
DesignItem represents a design item
type Error ¶
type Error struct {
Message string `json:"message"`
Path []interface{} `json:"path,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
Error represents a GraphQL error
type Frame ¶
type Frame struct {
ID int `json:"id"`
FrameLinkID string `json:"frame_link_id"`
FileID int `json:"file_id"`
Name string `json:"name"`
Status string `json:"status"`
}
Frame represents a MoMorph frame
type FrameBasic ¶
type FrameBasic struct {
ID int `json:"id"`
FrameLinkID string `json:"frame_link_id"`
Name string `json:"name"`
}
FrameBasic represents basic frame info for linked frame validation
type FrameTestCase ¶
type FrameTestCase struct {
ID int `json:"id"`
TestcasableID int `json:"testcasable_id"`
Content json.RawMessage `json:"content"`
BaseStructure json.RawMessage `json:"base_structure"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
FrameTestCase represents a test case for a frame
type MorpheusUser ¶
MorpheusUser represents a MoMorph user
type Request ¶
type Request struct {
Query string `json:"query"`
Variables map[string]interface{} `json:"variables,omitempty"`
}
Request represents a GraphQL request
type Response ¶
type Response struct {
Data json.RawMessage `json:"data,omitempty"`
Errors []Error `json:"errors,omitempty"`
}
Response represents a GraphQL response