Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GraphQL Operations for Event #66

Closed

Conversation

SriramPatibanda
Copy link
Member

@SriramPatibanda SriramPatibanda commented Apr 17, 2021

Solved or Linked Issues

Fixes #59
Reference any and all issues solved and related to this pull request here. Mention if there are none.

Description and Changes

  • Add Event Type
  • Add Event Query
  • Add Event Mutation
  • Add Event Resolver

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a work/topic/feature/bugfix branch (right side). Don't request your default branch!
  • Make sure you are making a pull request against the development (left side). Also you should start your branch off default branch and follow the branch naming guidelines.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.
  • I have added necessary documentation and mentioned the related issues (if appropriate)
  • I have added the appropriate labels, requested a review from a repository manager and assigned myself to this pull request.

Post merge checklist

@DesignrKnight DesignrKnight changed the title Wip/gql/event Add GraphQL Operations for Event Apr 17, 2021
name: { type: GraphQLString },
startTS: { type: GraphQLDateTime },
endTS: { type: GraphQLDateTime },
poster: { type: GraphQLID },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poster of type GraphQLID?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to what we've planned, we'll be having a media collection, and we would just refer to the id of that media where ever required.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll be a an ID in database but should resolve to poster and its blurhash here, isn't it?

endTS: { type: GraphQLDateTime },
poster: { type: GraphQLID },
type: { type: GraphQLInt },
host: { type: GraphQLID },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we resolving the host from its ID?

Comment on lines +40 to +44
createdAt: { type: GraphQLID },
createdBy: { type: GraphQLID },
updatedAt: { type: GraphQLDateTime },
updatedBy: { type: GraphQLID },
schemaVersion: { type: GraphQLInt },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these five needed in GraphQL?

server/schema/event/event.query.js Outdated Show resolved Hide resolved
server/schema/event/event.query.js Outdated Show resolved Hide resolved
Comment on lines 62 to 69
name: name,
startTS: startTS,
endTS: endTS,
poster: poster,
type: type,
host: host,
url: url,
venue: venue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't this part give an ESLint warning?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add schemaVersion, CAt, UAt, CBy, UBy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't this part give an ESLint warning?

What warning exactly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format
{url:url}
can be reduced to
{url}

When key and value have same name

info,
_EventModel = EventModel
) => {
try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a check to see if an event of that ID exists
Only Future events should be updated

Comment on lines 121 to 132
listEvents: async (parent, { limit = DEF_LIMIT, offset = DEF_OFFSET }, context, info, _EventModel = EventModel) => {
try {
const _events = await _EventModel.find().skip(offset).limit(limit);
return _events;
} catch (e) {
if (e instanceof GraphQLError) {
return e;
}
return APIError(null, e);
}
},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only future events should be listed, or there should be a flag to show past events
The UI needs a list of events in time/date ordered, where is that handled?

type: new GraphQLNonNull(GraphQLString),
},
},
resolve: searchEvents,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this resolver not yet done?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seach events isn't being done rn as @rutajdash told the approach we though of following was very expensive. After we decide on how to do it, it'll be done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO or create an issue

server/schema/event/event.mutation.js Show resolved Hide resolved
@SriramPatibanda SriramPatibanda self-assigned this Apr 18, 2021
@rutajdash rutajdash added the wip Work in Progress label May 4, 2021
@rutajdash rutajdash added this to the Phase 1 Launch milestone Oct 5, 2021
@rutajdash rutajdash removed this from the Phase 1 Launch milestone Oct 19, 2021
@rutajdash rutajdash closed this Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work in Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Event Schema
3 participants