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

Fieldname Audit #221

Closed
CodeProKid opened this issue Sep 12, 2017 · 3 comments
Closed

Fieldname Audit #221

CodeProKid opened this issue Sep 12, 2017 · 3 comments
Labels
scope: docs Updating, correcting, and improving documentation
Milestone

Comments

@CodeProKid
Copy link
Member

Now that we have a lot more coverage with mutations & queries, we should do an audit to make sure that things are named logically. We should additionally make sure that field names are consistent between queries and mutations within Types.

@CodeProKid CodeProKid added the component: architecture Relating to fundamental architectural decisions label Sep 12, 2017
@CodeProKid CodeProKid added this to the 1.0 release milestone Sep 12, 2017
@CodeProKid CodeProKid self-assigned this Oct 10, 2017
@CodeProKid CodeProKid added the status: in progress Currently being worked on label Oct 10, 2017
@jasonbahl
Copy link
Collaborator

@CodeProKid do you have notes to share from the Audit you did for this?

@jasonbahl
Copy link
Collaborator

What the field Audit should accomplish:

  • Does the REST API have a field that WPGraphQL doesn't?

  • Types

    • Name:
      • ucfirst, camelCase, like Post, Tag, PostConnection
      • Is the name too valuable?
      • Is the name too vague?
      • Unions and Enum should be suffixed with Enum and Union, like PostTypeEnum and PostObjectUnion
    • Description:
      • Description should exist and be accurate
    • Fields
      • Does the Type expose all the Fields that are needed to get the necessary data for the Type?
      • Do Field Audit on each field
  • Fields

    • Boolean fields start with is, has or can?
      • (should research how Twitter, etc are standardizing this)
    • Field name should be lcfirst, camelCase, like posts or firstName
    • Is the field name appropriate?
      • Is the name too valuable?
      • Is the name too vague?
    • Field should have a description
      • description should make sense and be accurate for what/how it resolves.
      • description should mention if it's marked isPrivate or has a custom authCallback
      • sprintf() should actually return something (see descriptions for )
    • Auth?
      • Should the field be marked isPrivate?
      • Should the field have a custom authCallback?
    • Resolving Type
      • Does the Type the field resolves to make sense?
        • Is the Type a scalar or an Object Type?
        • Does the Type have the proper fields to access what's needed?
  • Field Args

  • Connections should have: first, last, after, before, and where

    • Where args should make sense
    • Where args should do something
    • Naming conventions should be consistent across all field args
      • for example, if 2 fields have a way to order them, use the same fieldname orderby or whatever, instead of order for one and orderBy for the other. . .just make it consistent.
    • Args that WordPress allows to have a string or array should probably just accept a listOf in WPGraphQL, or 2 options, like status: StatusEnum and stati: [StatusEnum]
  • Mutations

  • Input

    • Input fields should be consistently named with the fields that can be queried.
      • doesn't have to be exactly the same, because mutations are different, but they should use similar terminology, etc
  • Output

    • Output fields should provide enough info to update the state when a mutation occurs
      • Like mutating a Post by changing it's terms needs to update the state for the Post and the Term, and potentially the list(s) of items they belong in

@CodeProKid CodeProKid removed their assignment Sep 4, 2018
@CodeProKid CodeProKid added scope: docs Updating, correcting, and improving documentation and removed component: architecture Relating to fundamental architectural decisions status: in progress Currently being worked on labels Sep 4, 2018
@jasonbahl
Copy link
Collaborator

@CodeProKid I'm closing this as we've undergone many changes in the mean time and have seen a lot of cleanup along the way

This was referenced May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs Updating, correcting, and improving documentation
Projects
None yet
Development

No branches or pull requests

2 participants