Skip to content

Instantly share code, notes, and snippets.

View xperiandri's full-sized avatar

Andrii Chebukin xperiandri

View GitHub Profile
mutation grupo ($id: GrupoID!, $addAdminCommand: AddAdminCommand!, $description: String, $imageURL: GrupoImageURL!, $name: GrupoName!, $removeAdminCommand: RemoveAdminCommand!) {
grupo_addAdmin (id: $id, addAdminCommand: $addAdminCommand)
grupo_delete (id: $id)
grupo_join (id: $id)
grupo_leave (id: $id)
grupo_patch (id: $id) {
description (description: $description)
imageURL (imageURL: $imageURL)
name (name: $name)
let asyncGetGrupo (ctx : ResolveFieldContext) _ = asyncResult {
let container = ctx.Root.BibliotekoDatabase.GrupojContainer
let! grupoId = ctx.ArgId
return! asyncGetGrupo container grupoId |> AsyncResult.mapError ErrorMappings.mapGrupoError
}
public Task<Grupo> GetGrupoAsync(ResolveFieldContext: ctx, Root: _)
{
var cointainer = ctx.Root.BibliotekoDatabase.GrupojContainer;
let InputRegistriCultureType =
Define.InputObject<RegistriCulture>
(name = "InputCulture",
fields =
[ Define.Input ("kind" , String , description = "A kind of book culture: native or translated")
Define.Input ("culture", CultureInfoType, description = "A culture code of a book") ])
// C#
// Define.Input (name: "kind", type: String, defaultValue: null, description: "A kind of book culture: native or translated")
// static var Mutation = Define.Object<Root>(...)
let Mutation =
Define.Object<Root> (
...
fields = [ Define.AsyncField (
...
inputs = [ Define.Input ("command", SetCommentInputType) ],
...) ])
// static var Query = Define.Object<Root>(...)
let Query =
Define.Object<Root>
(name = "Query",
fields = [ Define.AsyncField (
name = "grupoj",
type = ListOf GrupoType,
resolver = asyncGetRecenzoj) ])
type Root (serviceProvider : IServiceProvider,
user : Lazy<Result<GraphQLUser, ErrorMessage>>,
facebookService : Lazy<Result<IFacebookService, ErrorMessage>>,
securityOptions : IOptions<SecurityOptions>) =
let securityOptions = securityOptions.Value
member val RequestId = System.Guid.NewGuid () with get
type Reaction = enum Reaction
{
| Undefined = 0 Undefined = 0,
| Cool = 1 Cool = 1,
| LoveIt = 2 LoveIt = 2,
| Boring = 3 Boring = 3,
| Gripping = 4 Gripping = 4,
| Sad = 5 Sad = 5,
| Inspiring = 6 Inspiring = 6