Esempio n. 1
0
        public GraphQLQuery(GraphQLService graphQLService, EntityService entityService)
        {
            Name = "Query";
            var schemas = entityService.GetCollectionSchemas();

            foreach (var metaColl in schemas)
            {
                if (Fields.Count(x => x.Name == metaColl.CollectionName) == 0)
                {
                    JObjectRawType type     = new JObjectRawType(this, graphQLService, metaColl, entityService);
                    ListGraphType  listType = new ListGraphType(type);

                    AddField(new FieldType
                    {
                        Name         = metaColl.CollectionName,
                        Type         = listType.GetType(),
                        ResolvedType = listType,
                        Resolver     = new JObjectFieldResolver(graphQLService, entityService),
                        Arguments    = new QueryArguments(
                            type.TableArgs
                            )
                    });
                }
            }
        }
Esempio n. 2
0
        public GraphQLQuery(GraphQLService graphQLService)
        {
            Name = "Query";
            foreach (var key in graphQLService.Collections.Keys)
            {
                Library.Schema.CollectionSchema metaColl = graphQLService.Collections[key];
                CollectionType type     = new CollectionType(metaColl, graphQLService.Collections, graphQLService);
                ListGraphType  listType = new ListGraphType(type);

                AddField(new FieldType
                {
                    Name         = metaColl.CollectionName,
                    Type         = listType.GetType(),
                    ResolvedType = listType,
                    Resolver     = new JObjectFieldResolver(graphQLService),
                    Arguments    = new QueryArguments(
                        type.TableArgs
                        )
                });
            }
        }