Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

GraphQL #139

Closed
wants to merge 67 commits into from
Closed

GraphQL #139

wants to merge 67 commits into from

Conversation

lucassabreu
Copy link
Member

@lucassabreu lucassabreu commented Jun 5, 2018

connected to #297

Schema a ser desenvolvido:

Types:

  • Organization
    • id:Int!, email:String!, logo:String!, name:String!, phone:String!, slug:String!, video:String!,about:String!,address:Address!
  • Address
    • city:String, complement:String, neighbordhood:String, number:String, state:String, street:String, zipcode:String
  • Category
    • icon:String!, id:Int!, name:String!
    • needsCount:Int!
  • Need
    • category: Category, description: String!, dueDate: Date, id: Int!, organization: Organization, reachedQuantity: Int, requiredQuantity: Int, status: NeedStatus, title: String!, unity: String
    • createdAt:Date
    • updatedAt:Date
    • images: [NeedImage]
  • NeedImage
    • id:Int!,name:String!,url:String!
  • OrganizationImage
    • id:Int!,name:String!,url:String!
  • NeedStatus: ACTIVE, INACTIVE
  • LoginResult:
    • organization:Organization, token:String!

Queries:

  • allCategories(): [Category]
  • category(id:Int!): Category
  • need(id:Int!): Need
  • organization(id:Int!): Organization
  • search(categories:[Int],organization:Int,page:Int,text:String): [Need]
  • viewer(token:String!): Organization

Mutations:

  • login(email:String!, password:String!): LoginResult
  • viewer(token:String!):ViewerMutation
  • subscribeToOrganization(input:SubscribeOrganizationInput): SubscribeOrganizationPayload
    • SubscribeOrganizationInput
      • organizationId:Int!
      • email:String!
    • SubscribeOrganizationPayload
      • organization:Organization
  • unsubscribeToOrganization(input:UnsubscribeOrganizationInput): UnsubscribeOrganizationPayload
    • UnsubscribeOrganizationInput
      • organizationId:Int!
      • email:String!
    • UnsubscribeOrganizationPayload
      • organization:Organization
      • email:String!
  • resetPassword(input:ResetPasswordInput):ResetPasswordPaylod
    • ResetPasswordInput
      • token:String!
      • newPassword:String!
    • ResetPasswordPayload
      • organization:Organization
  • answerNeed(input:AnswerNeedInput):AnswerNeedPaylod
    • AnswerNeedInput
      • email:String, name:String!,phone:String,address:AddressInput,message:String!
    • AnswerNeedPaylod
      • need:Need

ViewerMutation

  • needCreate(input: NeedCreateInput): NeedCreatePayload
    • NeedCreateInput
      • unity: String!, dueDate: Date, categoryId: Int!, title: String!, description: String!, requiredQuantity: Int, reachedQuantity: Int
    • NeedCreatePayload
      • need: Need
  • needUpdate(input: NeedUpdateInput): NeedUpdatePayload
    • NeedUpdateInput
      • id:Int!
      • patch: NeedPatchInput!
    • NeedPatchInput
      • reachedQuantity: Int, unity: String, dueDate: Date, categoryId: Int, status: NeedStatus, title: String, description: String, requiredQuantity: Int
  • needImageCreate(input: NeedImageCreateInput): NeedImageCreatePayload
    • NeedImageCreateInput
      • name:String!, file:Upload
    • NeedImageCreatePayload
      • need: Need
      • image: NeedImage
  • needImageDelete(input: NeedImageDeleteInput): NeedImageDeletePayload
    • NeedImageDeleteInput
      • needImageId:Int!
    • NeedImageDeletePayload
      • need: Need
      • image: NeedImage
  • organizationUpdate(input: OrganizationUpdateInput): OrganizationUpdatePayload
    • OrganizationUpdateInput
      • address: AddressInput, name: String, logo: String, phone: String, about: String, video: String, email: String
    • AddressInput
      • neighbordhood: String, city: String, state: String, zipcode: String, street: String, number: String, complement: String
    • OrganizationUpdatePayload
      • organization: Organization
  • updatePassword(input: UpdatePasswordInput): UpdatePasswordPayload
    • UpdatePasswordInput
      • currentPassword: String!, newPassword: String!
    • UpdatePasswordPayload
      • organization: Organization
  • organizationImageCreate(input:OrganizationImageCreateInput): OrganizationImageCreatePayload
    • OrganizationImageCreateInput
      • name:String!, file:Upload
    • OrganizationImageCreatePayload
      • organization:Organization
      • image: OrganizationImage
  • organizationImageDelete(input:OrganizationImageDeleteInput): OrganizationImageDeletePayload
    • OrganizationImageDeleteInput
      • organizationImageId:Int!
    • OrganizationImageDeletePayload
      • organization:Organization
      • image:OrganizationImage

@codecov-io
Copy link

codecov-io commented Jun 5, 2018

Codecov Report

Merging #139 into master will increase coverage by 21.01%.
The diff coverage is 75.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #139       +/-   ##
==========================================
+ Coverage   22.88%   43.9%   +21.01%     
==========================================
  Files          26      47       +21     
  Lines        1302    2091      +789     
==========================================
+ Hits          298     918      +620     
- Misses        974    1129      +155     
- Partials       30      44       +14
Impacted Files Coverage Δ
server/handlers/json-structs.go 77.77% <ø> (ø) ⬆️
server/handlers/auth.go 51.78% <0%> (-3.99%) ⬇️
server/db/repo/category.go 0% <0%> (ø) ⬆️
server/db/repo/search.go 0% <0%> (ø) ⬆️
server/db/repo/organization.go 0% <0%> (ø) ⬆️
server/db/repo/need.go 0% <0%> (ø) ⬆️
server/graphql/allCategoriesQuery.go 100% <100%> (ø)
server/graphql/organizationQuery.go 100% <100%> (ø)
server/graphql/organizationImageDeleteMutation.go 100% <100%> (ø)
server/graphql/viewerQuery.go 100% <100%> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ba1bd1...dea782f. Read the comment docs.

"github.com/graphql-go/graphql"
)

type getAllCatsFn func() ([]model.Category, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Jul 31, 2018
@Coderockr Coderockr deleted a comment Aug 1, 2018
@Coderockr Coderockr deleted a comment Aug 2, 2018
@Coderockr Coderockr deleted a comment Aug 2, 2018
@Coderockr Coderockr deleted a comment Aug 2, 2018
@Coderockr Coderockr deleted a comment Aug 3, 2018
@Coderockr Coderockr deleted a comment Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants