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

Improve the documentation #326

Closed
innovaweb-dev opened this issue Apr 22, 2021 · 2 comments
Closed

Improve the documentation #326

innovaweb-dev opened this issue Apr 22, 2021 · 2 comments

Comments

@innovaweb-dev
Copy link

innovaweb-dev commented Apr 22, 2021

The topic about the Interface is not clear for me.
Can someone to give me explain and a exemple to create and use a Interface with graphql-compose.

https://graphql-compose.github.io/docs/basics/understanding-types.html#interfaces-via-interfacetypecomposer
For exemple, I don't understand this parts value => (value instanceof UserDoc) and where from UserDoc ?

Update message

After some hours on graphql-compose, I see that some functions are not enough documented with a complete example.
Like InterfaceTypeComposer previously, I can't understand also how to use a inputType after created it with InputTypeComposer.

For the beginer like me, the documentation is well done at the begining, to create schema, query and mutation, that clear.
But when I go to advenced concept like Interface, Input and Union, the explains and examples are not sufficient.

Same things with "ThunkComposer" and "Extensions Methods", what is ?

Update message

What are the "Field Args methods" used for?
graphql-compose can manage introspection ?

Thanks,

@innovaweb-dev innovaweb-dev changed the title Example to use InterfaceTypeComposer Example to use InterfaceTypeComposer, InputTypeComposer (Improve the documentation) Apr 23, 2021
@innovaweb-dev innovaweb-dev changed the title Example to use InterfaceTypeComposer, InputTypeComposer (Improve the documentation) Improve the documentation May 1, 2021
@nodkz
Copy link
Member

nodkz commented May 5, 2021

Sorry for the late response. I don't have enough free time to polish all things.

graphql-compose can manage introspection ?

Yes and no. Before calling schemaComposer.buildSchema() you may change your types as you wish even removing any field. For example, via graphql-compose-mongoose generator you may create graphql types & resolvers from mongoose schema; and before schema construction, you may remove/add/modify any field.

Same things with "ThunkComposer" and "Extensions Methods", what is ?

ThunkComposer - it's an internal wrapper that helps to solve hoisting problems when several javascript modules imports each other. ThunkComposer used internally and unwraps only when you call schemaComposer.buildSchema().

Extensions Methods – methods that allow manipulation of some additional data (configuration options, callback etc like Directives) in GraphQL types. In graphql-js it was added in graphql/graphql-js#2097. And discussed in graphql/graphql-js#1527 and graphql/graphql-js#1343

Can someone to give me explain and a exemple to create and use a Interface with graphql-compose.

Before returning data from resolver graphql want to determine which exact Type should be used for returning data.
You may take a look at this test case

it('integration test', async () => {

@innovaweb-dev
Copy link
Author

innovaweb-dev commented May 14, 2021

Thanks, success for your work.
Great package, but I hope that documentation will be improve someday. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants