GQL Server running again
This commit is contained in:
parent
2cdbd076fa
commit
1e45f9fb86
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"README_schema" : "Specifies how to load the GraphQL schema that completion, error highlighting, and documentation is based on in the IDE",
|
||||||
|
"schema": {
|
||||||
|
"README_file" : "Remove 'file' to use request url below. A relative or absolute path to the JSON from a schema introspection query, e.g. '{ data: ... }' or a .graphql/.graphqls file describing the schema using GraphQL Schema Language. Changes to the file are watched.",
|
||||||
|
"file": "./server/src/schema.graphql"
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
export type Maybe<T> = T | null;
|
export type Maybe<T> = T | null;
|
||||||
|
|
||||||
export interface EventsQueryFilter {
|
export interface EventsQueryFilter {
|
||||||
count?: Maybe<number>;
|
limit?: Maybe<number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SignupInput {
|
export interface SignupInput {
|
||||||
|
@ -24,6 +24,8 @@ export interface RequestInviteInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateEventInput {
|
export interface CreateEventInput {
|
||||||
|
owner: string;
|
||||||
|
|
||||||
time?: Maybe<EventTimeInput>;
|
time?: Maybe<EventTimeInput>;
|
||||||
|
|
||||||
info?: Maybe<(Maybe<EventInformationInput>)[]>;
|
info?: Maybe<(Maybe<EventInformationInput>)[]>;
|
||||||
|
@ -31,7 +33,10 @@ export interface CreateEventInput {
|
||||||
location?: Maybe<EventLocationInput>;
|
location?: Maybe<EventLocationInput>;
|
||||||
|
|
||||||
meta?: Maybe<EventMetaInput>;
|
meta?: Maybe<EventMetaInput>;
|
||||||
owner: string
|
|
||||||
|
status: string;
|
||||||
|
|
||||||
|
contact: EventContactPersonInput[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventTimeInput {
|
export interface EventTimeInput {
|
||||||
|
@ -70,6 +75,14 @@ export interface EventMetaInput {
|
||||||
tags?: Maybe<(Maybe<string>)[]>;
|
tags?: Maybe<(Maybe<string>)[]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EventContactPersonInput {
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
languages?: Maybe<Language[]>;
|
||||||
|
|
||||||
|
contact?: Maybe<Contact>;
|
||||||
|
}
|
||||||
|
|
||||||
export interface EventContactInput {
|
export interface EventContactInput {
|
||||||
email?: Maybe<string>;
|
email?: Maybe<string>;
|
||||||
|
|
||||||
|
@ -128,7 +141,7 @@ export interface CalendarEvent {
|
||||||
|
|
||||||
owner: User;
|
owner: User;
|
||||||
|
|
||||||
info: EventInformation[];
|
info: (Maybe<EventInformation>)[];
|
||||||
|
|
||||||
time: EventTime;
|
time: EventTime;
|
||||||
|
|
||||||
|
@ -227,6 +240,8 @@ export interface RequestInviteMutationArgs {
|
||||||
}
|
}
|
||||||
export interface CreateEventMutationArgs {
|
export interface CreateEventMutationArgs {
|
||||||
input?: Maybe<CreateEventInput>;
|
input?: Maybe<CreateEventInput>;
|
||||||
|
|
||||||
|
foo?: Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
import { ObjectID } from "mongodb";
|
import { ObjectID } from "mongodb";
|
||||||
|
@ -242,11 +257,11 @@ export interface UserDbObject {
|
||||||
export interface CalendarEventDbObject {
|
export interface CalendarEventDbObject {
|
||||||
_id: ObjectID;
|
_id: ObjectID;
|
||||||
owner: ObjectID;
|
owner: ObjectID;
|
||||||
info: Maybe<(Maybe<EventInformationDbObject>)[]>;
|
info: (Maybe<EventInformationDbObject>)[];
|
||||||
time: Maybe<EventTimeDbObject>;
|
time: EventTime;
|
||||||
status: EventStatus;
|
status: EventStatus;
|
||||||
contact: Maybe<EventContactPersonDbObject[]>;
|
contact: EventContactPersonDbObject[];
|
||||||
location: Maybe<Location>;
|
location: LocationDbObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventInformationDbObject {
|
export interface EventInformationDbObject {
|
||||||
|
@ -255,28 +270,10 @@ export interface EventInformationDbObject {
|
||||||
description: Maybe<string>;
|
description: Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventTimeDbObject {
|
|
||||||
timeZone: Maybe<TimeZone>;
|
|
||||||
start: Maybe<Timestamp>;
|
|
||||||
end: Maybe<Timestamp>;
|
|
||||||
recurrence: Maybe<string>;
|
|
||||||
exceptions: Maybe<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EventContactPersonDbObject {
|
export interface EventContactPersonDbObject {
|
||||||
name: string;
|
name: string;
|
||||||
languages: Maybe<Language[]>;
|
languages: Maybe<LanguageDbObject[]>;
|
||||||
contact: Maybe<ContactDbObject>;
|
contact: Maybe<Contact>;
|
||||||
}
|
|
||||||
|
|
||||||
export interface ContactDbObject {
|
|
||||||
email: Maybe<string>;
|
|
||||||
phone: Maybe<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GeoCoordinateDbObject {
|
|
||||||
lat: Maybe<number>;
|
|
||||||
lng: Maybe<number>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserSessionDbObject {
|
export interface UserSessionDbObject {
|
||||||
|
@ -413,19 +410,15 @@ export namespace CalendarEventResolvers {
|
||||||
|
|
||||||
owner?: OwnerResolver<User, TypeParent, Context>;
|
owner?: OwnerResolver<User, TypeParent, Context>;
|
||||||
|
|
||||||
info?: InfoResolver<
|
info?: InfoResolver<(Maybe<EventInformation>)[], TypeParent, Context>;
|
||||||
Maybe<(Maybe<EventInformation>)[]>,
|
|
||||||
TypeParent,
|
|
||||||
Context
|
|
||||||
>;
|
|
||||||
|
|
||||||
time?: TimeResolver<Maybe<EventTime>, TypeParent, Context>;
|
time?: TimeResolver<EventTime, TypeParent, Context>;
|
||||||
|
|
||||||
status?: StatusResolver<EventStatus, TypeParent, Context>;
|
status?: StatusResolver<EventStatus, TypeParent, Context>;
|
||||||
|
|
||||||
contact?: ContactResolver<Maybe<EventContactPerson[]>, TypeParent, Context>;
|
contact?: ContactResolver<EventContactPerson[], TypeParent, Context>;
|
||||||
|
|
||||||
location?: LocationResolver<Maybe<Location>, TypeParent, Context>;
|
location?: LocationResolver<Location, TypeParent, Context>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IdResolver<
|
export type IdResolver<
|
||||||
|
@ -439,12 +432,12 @@ export namespace CalendarEventResolvers {
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
export type InfoResolver<
|
export type InfoResolver<
|
||||||
R = Maybe<(Maybe<EventInformation>)[]>,
|
R = (Maybe<EventInformation>)[],
|
||||||
Parent = CalendarEvent,
|
Parent = CalendarEvent,
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
export type TimeResolver<
|
export type TimeResolver<
|
||||||
R = Maybe<EventTime>,
|
R = EventTime,
|
||||||
Parent = CalendarEvent,
|
Parent = CalendarEvent,
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
|
@ -454,12 +447,12 @@ export namespace CalendarEventResolvers {
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
export type ContactResolver<
|
export type ContactResolver<
|
||||||
R = Maybe<EventContactPerson[]>,
|
R = EventContactPerson[],
|
||||||
Parent = CalendarEvent,
|
Parent = CalendarEvent,
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
export type LocationResolver<
|
export type LocationResolver<
|
||||||
R = Maybe<Location>,
|
R = Location,
|
||||||
Parent = CalendarEvent,
|
Parent = CalendarEvent,
|
||||||
Context = {}
|
Context = {}
|
||||||
> = Resolver<R, Parent, Context>;
|
> = Resolver<R, Parent, Context>;
|
||||||
|
@ -672,6 +665,8 @@ export namespace MutationResolvers {
|
||||||
> = Resolver<R, Parent, Context, CreateEventArgs>;
|
> = Resolver<R, Parent, Context, CreateEventArgs>;
|
||||||
export interface CreateEventArgs {
|
export interface CreateEventArgs {
|
||||||
input?: Maybe<CreateEventInput>;
|
input?: Maybe<CreateEventInput>;
|
||||||
|
|
||||||
|
foo?: Maybe<string>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import EventManager from './EventManager'
|
import EventManager from './EventManager'
|
||||||
import CalendarManager from "../Calendar/CalendarManager";
|
import CalendarManager from "../Calendar/CalendarManager";
|
||||||
import CreateEventResolver = MutationResolvers.CreateEventResolver;
|
import CreateEventResolver = MutationResolvers.CreateEventResolver;
|
||||||
import {MutationResolvers} from "../@types";
|
import {CalendarEventResolvers, MutationResolvers} from "../@types";
|
||||||
import CreateEventArgs = MutationResolvers.CreateEventArgs;
|
import CreateEventArgs = MutationResolvers.CreateEventArgs;
|
||||||
|
|
||||||
export default class EventsResolvers {
|
export default class EventsResolvers {
|
||||||
|
@ -19,6 +19,12 @@ export default class EventsResolvers {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Event = {
|
||||||
|
owner: async (event, args, context, info) => {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Mutation: {
|
Mutation: {
|
||||||
createEvent: CreateEventResolver
|
createEvent: CreateEventResolver
|
||||||
} = {
|
} = {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import EventsResolvers from './Events/eventsResolvers'
|
||||||
import {importSchema} from 'graphql-import';
|
import {importSchema} from 'graphql-import';
|
||||||
import AuthResolvers from "./Auth/authResolvers";
|
import AuthResolvers from "./Auth/authResolvers";
|
||||||
import { DIRECTIVES } from 'graphql-codegen-typescript-mongodb';
|
import { DIRECTIVES } from 'graphql-codegen-typescript-mongodb';
|
||||||
|
import {readFileSync} from "fs";
|
||||||
|
|
||||||
interface Dependencies {
|
interface Dependencies {
|
||||||
repository: Repository,
|
repository: Repository,
|
||||||
|
@ -44,10 +45,13 @@ export default class GraphQLInterface {
|
||||||
userManager: this.userManager
|
userManager: this.userManager
|
||||||
})
|
})
|
||||||
|
|
||||||
const typeDefs = importSchema(__dirname + '/schema.graphql');
|
const typeDefs = readFileSync(__dirname + '/schema.graphql', 'utf8');
|
||||||
|
|
||||||
const schema = makeExecutableSchema({
|
const schema = makeExecutableSchema({
|
||||||
typeDefs,
|
typeDefs: [
|
||||||
|
DIRECTIVES,
|
||||||
|
typeDefs
|
||||||
|
],
|
||||||
resolvers: {
|
resolvers: {
|
||||||
Query: {
|
Query: {
|
||||||
...this.resolvers.Query,
|
...this.resolvers.Query,
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
type User {
|
type User @entity {
|
||||||
firstName: String!
|
firstName: String! @column
|
||||||
lastName: String
|
lastName: String @column
|
||||||
username: String!
|
username: String! @column
|
||||||
email: String!
|
email: String! @column
|
||||||
id: ID!
|
id: ID! @id
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar Date
|
scalar Date
|
||||||
|
|
||||||
type UserSession {
|
type UserSession @entity {
|
||||||
hash: String!
|
hash: String! @column
|
||||||
user: User!
|
user: User! @link
|
||||||
ctime: Date!
|
ctime: Date! @column
|
||||||
isValid: Boolean!
|
isValid: Boolean! @column
|
||||||
}
|
}
|
||||||
|
|
||||||
input SignupInput {
|
input SignupInput {
|
||||||
|
@ -35,14 +35,14 @@ input RequestInviteInput {
|
||||||
# ------
|
# ------
|
||||||
|
|
||||||
|
|
||||||
type CalendarEvent {
|
type CalendarEvent @entity {
|
||||||
id: ID!
|
id: ID! @id
|
||||||
owner: User!
|
owner: User! @link
|
||||||
info: [EventInformation]!
|
info: [EventInformation]! @embedded
|
||||||
time: EventTime!
|
time: EventTime! @column
|
||||||
status: EventStatus!
|
status: EventStatus! @column
|
||||||
contact: [EventContactPerson!]!
|
contact: [EventContactPerson!]! @embedded
|
||||||
location: Location!
|
location: Location! @embedded
|
||||||
}
|
}
|
||||||
|
|
||||||
type Location {
|
type Location {
|
||||||
|
@ -77,19 +77,19 @@ scalar EventStatus
|
||||||
scalar Language
|
scalar Language
|
||||||
|
|
||||||
# Event information for presentation
|
# Event information for presentation
|
||||||
type EventInformation {
|
type EventInformation @entity {
|
||||||
language: String!
|
language: String! @column
|
||||||
title: String!
|
title: String! @column
|
||||||
description: String
|
description: String @column
|
||||||
}
|
}
|
||||||
|
|
||||||
type EventContactPerson {
|
type EventContactPerson @entity {
|
||||||
name: String!
|
name: String! @column
|
||||||
languages: [Language!]
|
languages: [Language!] @embedded
|
||||||
contact: Contact
|
contact: Contact @column
|
||||||
}
|
}
|
||||||
|
|
||||||
type Contact {
|
type Contact {
|
||||||
email: String
|
email: String
|
||||||
phone: String
|
phone: String
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,12 @@ input EventMetaInput {
|
||||||
tags: [String]
|
tags: [String]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input EventContactPersonInput {
|
||||||
|
name: String!
|
||||||
|
languages: [Language!]
|
||||||
|
contact: EventContactInput
|
||||||
|
}
|
||||||
|
|
||||||
input CreateEventInput {
|
input CreateEventInput {
|
||||||
owner: ID!
|
owner: ID!
|
||||||
time: EventTimeInput
|
time: EventTimeInput
|
||||||
|
@ -138,7 +144,7 @@ input CreateEventInput {
|
||||||
location: EventLocationInput
|
location: EventLocationInput
|
||||||
meta: EventMetaInput
|
meta: EventMetaInput
|
||||||
status: String!
|
status: String!
|
||||||
contact: [ContactPerson!]!
|
contact: [EventContactPersonInput!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
|
|
Loading…
Reference in New Issue