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

Allow more options to the Apollo Server config #7665

Merged
merged 24 commits into from Sep 4, 2020
Merged

Allow more options to the Apollo Server config #7665

merged 24 commits into from Sep 4, 2020

Conversation

abdonrd
Copy link
Contributor

@abdonrd abdonrd commented Sep 1, 2020

Description of what you did:

Allow more options to the Apollo Server config

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

Yeah sth like that would allow to pass any param the users want. In v4 we can break the config to have a apolloServerConfig key to make it cleaner :)

packages/strapi-plugin-graphql/hooks/graphql/index.js Outdated Show resolved Hide resolved
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
@alexandrebodin
Copy link
Member

sth wrong with the tests :)

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

this will need a doc update before we can merge and a deprecation warning :)

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
@abdonrd
Copy link
Contributor Author

abdonrd commented Sep 1, 2020

@alexandrebodin all updated! 🚀

How would you want to add a deprecation warning?

@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #7665 into master will increase coverage by 0.03%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7665      +/-   ##
==========================================
+ Coverage   27.16%   27.20%   +0.03%     
==========================================
  Files        1163     1164       +1     
  Lines       15518    15517       -1     
  Branches     2410     2410              
==========================================
+ Hits         4216     4221       +5     
+ Misses       9534     9528       -6     
  Partials     1768     1768              
Flag Coverage Δ
#front 19.36% <63.63%> (+0.04%) ⬆️
#unit 53.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...in/src/components/LeftMenu/LeftMenuFooter/index.js 33.33% <0.00%> (-33.34%) ⬇️
...rc/containers/EditViewDataManagerProvider/index.js 0.00% <0.00%> (ø)
.../admin/src/components/ComponentIconPicker/index.js 0.00% <0.00%> (ø)
...agerProvider/utils/retrieveComponentsFromSchema.js 68.75% <ø> (ø)
...rapi-plugin-upload/admin/src/translations/index.js 0.00% <ø> (ø)
...ovider/utils/getFieldsActionMatchingPermissions.js 100.00% <100.00%> (ø)
...ditViewDataManagerProvider/utils/tests/testData.js 100.00% <100.00%> (ø)
...rc/containers/InputModalStepperProvider/reducer.js 68.33% <100.00%> (ø)

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 5364191...e59d214. Read the comment docs.

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

@derrickmehaffy can you help @abdonrd to update the graphql doc with a deprecation warning for those old params

packages/strapi-plugin-graphql/hooks/graphql/index.js Outdated Show resolved Hide resolved
packages/strapi-plugin-graphql/hooks/graphql/index.js Outdated Show resolved Hide resolved
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
@alexandrebodin
Copy link
Member

@alexandrebodin all updated! 🚀

How would you want to add a deprecation warning?

I think we should remove the old keys from the default config. and if the user sets them display a warning with strapi.log.warn()

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
@derrickmehaffy
Copy link
Member

@alexandrebodin @abdonrd sure, we are just moving the tracing one right?

@abdonrd
Copy link
Contributor Author

abdonrd commented Sep 2, 2020

@alexandrebodin @abdonrd sure, we are just moving the tracing one right?

Yeah!

@derrickmehaffy
Copy link
Member

Would be best to just adjust the documentation and move this into a major release and throw the warning in the migration guide. It's small, and the number of people actually using the tracing feature should be very low as it decreases the performance of GraphQL quite a lot.

If you want to write something up here @abdonrd I'll just ensure it gets added to the next migration guide.

@alexandrebodin did we have a planned date for v3.2.x ?

@abdonrd
Copy link
Contributor Author

abdonrd commented Sep 2, 2020

@derrickmehaffy Done!

docs/v3.x/plugins/graphql.md Outdated Show resolved Hide resolved
@derrickmehaffy
Copy link
Member

Reminder to myself when we start looking at redoing the docs, this entire GraphQL documentation needs to be rewritten x_x

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
derrickmehaffy
derrickmehaffy previously approved these changes Sep 2, 2020
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM on the docs side, pending review from Alex on the code side

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>
@abdonrd
Copy link
Contributor Author

abdonrd commented Sep 3, 2020

Thanks again for the review @alexandrebodin! It should work now!

alexandrebodin and others added 3 commits September 3, 2020 12:26
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
@alexandrebodin alexandrebodin added this to the 3.1.5 milestone Sep 4, 2020
@alexandrebodin alexandrebodin added source: plugin:graphql Source is plugin/graphql package issue: enhancement Issue suggesting an enhancement to an existing feature labels Sep 4, 2020
@alexandrebodin alexandrebodin merged commit d2ef1d4 into strapi:master Sep 4, 2020
@abdonrd abdonrd deleted the graphql-config branch September 4, 2020 07:53
gfritzdev pushed a commit to gfritzdev/strapi that referenced this pull request Sep 7, 2020
* Extract server config to a constant

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Omit options to server config

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Move default config to serverParams

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Simplify Apollo server config

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Simplify with a new apolloServerConfig property

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Update tracing documentation

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Extract deprecated options

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Add default options

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Update documentation

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Rename to deprecatedApolloServerConfig

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Empty default options

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Update default config

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Add warning note

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Add documentation note

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Update documentation note

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Fix the config check

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Fix the config check

Signed-off-by: Abdón Rodríguez Davila <a@abdonrd.com>

* Refactor old code and rename param to appoloServer to avoid redondancy

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

* Fix typo

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Signed-off-by: Garrett Fritz <garrettfritz@garretts-mbp.home>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: plugin:graphql Source is plugin/graphql package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants