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

Decide on a new organizational structure for types #44

Closed
CodeProKid opened this issue Feb 22, 2017 · 1 comment
Closed

Decide on a new organizational structure for types #44

CodeProKid opened this issue Feb 22, 2017 · 1 comment

Comments

@CodeProKid
Copy link
Member

CodeProKid commented Feb 22, 2017

We need to decide on a new organizational structure for types. I recommended the following:

Within the Types folder, I think it would be good to have an Input folder and an Objects folder. We would then put all of the classes for query args in the Input folder, and the classes for object return values in the Objects folder. I think this naming convention most closely mimics the classes those classes are actually extending, but I could be open to something like "Input" and "Output" if you preferred that. I think this would really help clean up that folder since it's a little confusing what each of those classes is doing until you really dive into them. We could then put the RootQueryType in the root of the Types folder since that is different than everything else in there.

Then @jasonbahl came back with the structure from here: https://github.com/ParabolInc/action/tree/master/src/server/graphql/models

he said:

so, re structure. . .that's one thing I keep going back and forth on. . .it's hard to find any large open source examples of how folks are structuring. . .I think the largest example of an open source GraphQL server that I know of is: "Action" a Jira/Trello-esque app. . .here's how they structure their "types"

I don't think it matters which way we go, we just need to do something to organize the types.

@CodeProKid CodeProKid added this to the Pre Merge milestone Feb 22, 2017
@jasonbahl jasonbahl added this to In Progress in Expand Schema Feb 23, 2017
@CodeProKid
Copy link
Member Author

Let's try and go with this pattern, for now, where all the pieces relating to a specific Type are organized together. This should provide a more scalable pattern for plugin & theme developers to follow if/when folks start defining their own GraphQL Schemas for Types their code provides:

/Type/User
/Type/User/UserType
/Type/User/UserQuery
/Type/User/UserMutation
/Type/User/Connection
/Type/User/Connection/UserConnectionArgs
/Type/User/Connection/UserConnectionDefinition
/Type/User/Connection/UserConnectionResolver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants