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

Feature/taxonomy #79

Merged
merged 26 commits into from
Jan 15, 2020
Merged

Feature/taxonomy #79

merged 26 commits into from
Jan 15, 2020

Conversation

mattnield
Copy link
Contributor

@mattnield mattnield commented Nov 3, 2019

Motivation

Fixes #1 by adding basic taxonomy support.

Each taxonomy group can be returned as a nested group of taxonomy terms. So running something like this:

query MyQuery {
  allKontentTaxonomyPersonas {
    nodes {
      terms {
        terms {
          codename
          name
        }
        name
        codename
      }
      system {
        codename
        name
      }
    }
  }
}

will return:

{
  "data": {
    "allKontentTaxonomyPersonas": {
      "nodes": [
        {
          "terms": [
            {
              "terms": [
                {
                  "codename": "barista",
                  "name": "Barista"
                },
                {
                  "codename": "cafe_owner",
                  "name": "Cafe owner"
                }
              ],
              "name": "Coffee expert",
              "codename": "coffee_expert"
            },
            {
              "terms": [
                {
                  "codename": "coffee_lover",
                  "name": "Coffee lover"
                },
                {
                  "codename": "coffee_blogger",
                  "name": "Coffee blogger"
                }
              ],
              "name": "Coffee enthusiast",
              "codename": "coffee_enthusiast"
            }
          ],
          "system": {
            "codename": "personas",
            "name": "Personas"
          }
        }
      ]
    }
  }
}

Checklist

  • Code follows coding conventions held in this repo
  • Automated tests have been added
  • Tests are passing
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

None of the existing automated tests were relevant. All testing was done through use fo the GraphiQL explorer and building basic listings in Gatsby

@mattnield mattnield requested a review from Simply007 as a code owner November 3, 2019 01:14
@mattnield
Copy link
Contributor Author

Looks like I have an issue in the test scripts since merging in the latest master branch. I'll go back and figure out how to exclude the taxonomy from these tests because languages, tracing, and resolvers are not relevant to the taxonomy support.

@NathanDCox NathanDCox mentioned this pull request Nov 8, 2019
5 tasks
@NathanDCox
Copy link

I made a new pull request that implements this in a similar way. There are some formatting fixes, I added in tests in gatsby-node and added validation. Mine still doesn’t resolve the unnecessary tests in languages and resolvers failing the build though.

@mattnield
Copy link
Contributor Author

@NathanDCox - looks like we're working on the same thing then.

@mattnield
Copy link
Contributor Author

Hi @Simply007 , all is up to date now with passing tests and documentation. Let me know if you want to drop on a call to discuss.

@NathanDCox
Copy link

@mattnield - Looks like you got a working update. Looking forward to using this feature on an upcoming project.

Copy link
Contributor

@Simply007 Simply007 left a comment

Choose a reason for hiding this comment

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

Hey @mattnield!

thanks for the work you have done!

I do love the way you adopted the "architecture" of the plugin. 👍👍👍
Documentation + tests are also included. 🥇

Just one note:

  • I would probably make the taxonomy support configurable to allow the users to turn it off
    • I am still not decided whether opt-in or opt-out is better for default - what do you think?
    • I would love to do the same with type summit

We could definitely schedule a call and discuss is.

@mattnield
Copy link
Contributor Author

Hi @Simply007,

Thanks 😄

Yes, let's have a call about your suggestion:

  • I would probably make the taxonomy support configurable to allow the users to turn it off

If you're free tomorrow afternoon, that could work? We can speak on Slack 🤙

@Simply007
Copy link
Contributor

Sorry @mattnield to keep you waiting, but there is an issue with schema definition. When we have implemented the schema definition, the empty linked element value became null from empty array (well-spoted @bwlng).

Problem description here: https://github.com/Simply007/gatsby-null-instead-of-array

Copy link
Contributor

@Simply007 Simply007 left a comment

Choose a reason for hiding this comment

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

Hello @mattnield,

finally, we have released the v4.0.0, so I am ready to merge your pull request and release it as the v4.2 (we will skip 4.1 because it is currently used for gatsby preview development and it will be moved to v4.3)

I have left some rebranding tasks to finish (the snapshot update might need to be done after the changes).

Overall it is great! Thanks for your contribution!

mattnield and others added 2 commits January 15, 2020 11:48
…entResolver.spec.js.snap

Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
…c.js.snap

Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
mattnield and others added 7 commits January 15, 2020 11:48
….spec.js.snap

Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
…ence.spec.js.snap

Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
…ec.js.snap

Co-Authored-By: Ondřej Chrastina <9218736+Simply007@users.noreply.github.com>
Copy link
Contributor Author

@mattnield mattnield left a comment

Choose a reason for hiding this comment

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

Thanks, @Simply007. These are in and passing now.

@Simply007 Simply007 self-requested a review January 15, 2020 11:56
Copy link
Contributor

@Simply007 Simply007 left a comment

Choose a reason for hiding this comment

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

THX!

@Simply007 Simply007 merged commit 5b39338 into kontent-ai:master Jan 15, 2020
@Simply007
Copy link
Contributor

Hello @NathanDCox. I've just sent you an invitation to the Kentico GitHub organization. If you accept it, you'll be able to interact with other Kentico GitHub community members in out Global collaborators dicsussions as well as getting the fresh info about Kentico Github activity.

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

Successfully merging this pull request may close these issues.

Add support for taxonomies
3 participants