package queries import ( "context" "git.aiterp.net/rpdata/api/graphql/resolver/types" "git.aiterp.net/rpdata/api/model/file" ) // FileArgs is args for file query type FileArgs struct { ID string } // File resolves the file query func (r *QueryResolver) File(ctx context.Context, args *FileArgs) (*types.FileResolver, error) { file, err := file.FindID(args.ID) if err != nil { return nil, err } return &types.FileResolver{F: file}, nil }