Skip to content

Instantly share code, notes, and snippets.

@sammarks
Last active July 15, 2020 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sammarks/3e8517ad84ef03eb60f74ccdaed3792d to your computer and use it in GitHub Desktop.
Save sammarks/3e8517ad84ef03eb60f74ccdaed3792d to your computer and use it in GitHub Desktop.

BusinessU Classes Task

A critical aspect of BusinessU is managing classes and the students inside them. In order to facilitate communication between the frontend and the server, we use GraphQL, and for our frontend framework we use React.

The goal of this task is to give us an idea of your skill level before starting work for BusinessU.

For this task, implement a simple GraphQL server and frontend that is responsible for creating / updating / deleting classes.

Submit your code in a private repo and share with me. I am sammarks on BitBucket or sammarks on GitHub.

Specification

Server

Here is the GraphQL schema you'll need to use when implementing this:

type Class {
  id: ID!
  name: String!
}

type Query {
  classes: [Class!]!
}

input ClassInput {
  name: String!
}
input UpdateClassInput {
  id: ID!
  patch: ClassInput!
}
input DeleteClassInput {
  id: ID!
}

type ClassPayload {
  class: Class!
}
type SuccessPayload {
  success: Boolean!
}

type Mutation {
  createClass(input: ClassInput!): ClassPayload!
  updateClass(input: UpdateClassInput!): ClassPayload!
  deleteClass(input: DeleteClassInput!): SuccessPayload!
}

When implementing the GraphQL schema, we would discourage using libraries that automatically generate schema and resolvers. We want to make sure you know / can figure out GraphQL, not that you know how to use a tool that generates code.

Frontend

The frontend should have an interface for creating / editing / deleting classes.

You don't have to lay the UI out this way, but imagine each class is a box with a header containing the name, and inside that box is a placeholder for eventually adding student management (but not required for this task).

Other Requirements

  • Use the Apollo framework for the server-side and client-side GraphQL code. It'll make this easier!
  • Use ant.design as the UI framework for your frontend. This is the framework we use at BusinessU. Other than that, design isn't important for this task. Don't spend too much time making it pretty! Just make it work.

Bonus Points

  • Unit tests for backend code
  • Typescript (highly recommended)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment