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

Document GraphQL #3704

Merged
merged 7 commits into from
Jul 13, 2022
Merged

Document GraphQL #3704

merged 7 commits into from
Jul 13, 2022

Conversation

Premwoik
Copy link
Contributor

@Premwoik Premwoik commented Jul 11, 2022

This PR adds the documentation for the GraphQL HTTP handler and documents each endpoint type.

The Bool type in schemas was replaced with the Boolean type because Boolean is the correct type in GraphQL.

I also updated the CircleCI yml config to build the GraphQL static documentation with the SpectaQL tool.

image

image

image

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #3704 (85ef0f0) into master (bbdc781) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3704      +/-   ##
==========================================
+ Coverage   82.10%   82.12%   +0.01%     
==========================================
  Files         513      513              
  Lines       33644    33644              
==========================================
+ Hits        27624    27630       +6     
+ Misses       6020     6014       -6     
Impacted Files Coverage Δ
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/pubsub/nodetree_tree.erl 87.87% <0.00%> (-3.04%) ⬇️
src/mam/mod_mam_elasticsearch_arch.erl 86.60% <0.00%> (-1.79%) ⬇️
src/global_distrib/mod_global_distrib_receiver.erl 79.51% <0.00%> (-1.21%) ⬇️
src/pubsub/node_flat.erl 74.30% <0.00%> (-0.40%) ⬇️
src/pubsub/mod_pubsub_db_rdbms.erl 95.34% <0.00%> (-0.26%) ⬇️
src/mod_muc_room.erl 78.52% <0.00%> (-0.18%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/pubsub/mod_pubsub.erl 73.42% <0.00%> (+0.06%) ⬆️
src/pubsub/node_pep.erl 79.62% <0.00%> (+1.85%) ⬆️
... and 5 more

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 bbdc781...85ef0f0. Read the comment docs.

@mongoose-im

This comment was marked as outdated.

@Premwoik Premwoik force-pushed the document-graphql branch 2 times, most recently from 192e624 to 8c5be47 Compare July 11, 2022 07:46
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@Premwoik Premwoik marked this pull request as ready for review July 12, 2022 08:56
Copy link
Contributor

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

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

Looks good, I added some minor comments.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 13, 2022

small_tests_24 / small_tests / 8a0967f
Reports root / small


small_tests_25 / small_tests / 8a0967f
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 8a0967f
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 8a0967f
Reports root/ big
OK: 1739 / Failed: 0 / User-skipped: 460 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 8a0967f
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 8a0967f
Reports root/ big
OK: 3105 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 8a0967f
Reports root/ big
OK: 1739 / Failed: 0 / User-skipped: 460 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 8a0967f
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 8a0967f
Reports root/ big
OK: 3496 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 8a0967f
Reports root/ big
OK: 1845 / Failed: 0 / User-skipped: 354 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 8a0967f
Reports root/ big
OK: 2135 / Failed: 0 / User-skipped: 355 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 8a0967f
Reports root/ big
OK: 3496 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 8a0967f
Reports root/ big
OK: 3498 / Failed: 1 / User-skipped: 103 / Auto-skipped: 0

pubsub_SUITE:tree+node_config:send_last_published_item_test
{error,{{badmatch,false},
    [{pubsub_tools,check_response,2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,491}]},
     {pubsub_tools,receive_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,481}]},
     {pubsub_tools,receive_subscribe_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,334}]},
     {pubsub_SUITE,'-send_last_published_item_test/1-fun-0-',2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
            {line,937}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log


riak_mnesia_24 / riak_mnesia / 8a0967f
Reports root/ big
OK: 1994 / Failed: 0 / User-skipped: 350 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 8a0967f
Reports root/ big
OK: 3502 / Failed: 6 / User-skipped: 97 / Auto-skipped: 0

pep_SUITE:pep_tests:delayed_receive
{error,{{badmatch,[]},
    [{pep_SUITE,'-delayed_receive/1-fun-0-',3,
          [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
           {line,276}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log

pep_SUITE:pep_tests:h_ok_after_notify_test
{error,{{assertion_failed,assert_many,false,
              [is_roster_set,is_presence,is_presence],
              [],[]},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {escalus_story,'-make_all_clients_friends/1-fun-0-',2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,114}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
     {escalus_utils,distinct_pairs,2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,60}]},
     {escalus_story,make_all_clients_friends,1,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,106}]}]}}

Report log

pep_SUITE:pep_tests:publish_and_notify_test
{error,{{assertion_failed,assert_many,false,[is_roster_set],[],[]},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {escalus_story,'-make_all_clients_friends/1-fun-0-',2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,117}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
     {escalus_utils,distinct_pairs,2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,60}]},
     {escalus_story,make_all_clients_friends,1,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,106}]}]}}

Report log

pep_SUITE:pep_tests:authorize_access_model
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,<<"bob_authorize_access_model_2163@localhost/res1">>,
          escalus_tcp,<0.3259.2>,
          [{event_manager,<0.3214.2>},
           {server,<<"localhost">>},
           {username,<<"bOb_authorize_access_model_2163">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.3214.2>},
            {server,<<"localhost">>},
            {username,<<"bOb_authorize_access_model_2163">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"bob_authorize_access_model_2163">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"bOb_authorize_access_model_2163">>},
           {server,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"197f7d073a0aa185">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,480}]},
     {pubsub_tools,receive_and_check_response,4,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,471}]},
     {pep_SUITE,'-authorize_access_model/1-fun-0-',2,
 ...

Report log

pep_SUITE:pep_tests:send_caps_after_login_test
{error,{{assertion_failed,assert_many,false,
              [is_roster_set,is_presence,is_presence],
              [],[]},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {escalus_story,'-make_all_clients_friends/1-fun-0-',2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,114}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
     {escalus_utils,'-each_with_index/3-fun-0-',3,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,87}]},
     {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
     {escalus_utils,distinct_pairs,2,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_utils.erl"},
             {line,60}]},
     {escalus_story,make_all_clients_friends,1,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,106}]}]}}

Report log

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"bob_unsubscribe_after_presence_unsubscription_2165@localhost/res1">>,
          escalus_tcp,<0.3258.2>,
          [{event_manager,<0.3228.2>},
           {server,<<"localhost">>},
           {username,
             <<"bOb_unsubscribe_after_presence_unsubscription_2165">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.3228.2>},
            {server,<<"localhost">>},
            {username,
              <<"bOb_unsubscribe_after_presence_unsubscription_2165">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"bob_unsubscribe_after_presence_unsubscription_2165">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"bOb_unsubscribe_after_presence_unsubscription_2165">>},
           {server,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"4e820fbaa505dedd">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,480}]},
     {pubsub_tools,receive_and_check_...

Report log

Copy link
Contributor

@JanuszJakubiec JanuszJakubiec left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

It looks good in general, for some reason license link is incorrect: https://github.com/esl/MongooseIM/blob/master/COPYIN

doc/configuration/listen.md Outdated Show resolved Hide resolved
doc/graphql-api/Admin-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/Admin-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/Admin-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/Admin-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/Admin-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/User-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/User-GraphQL.md Outdated Show resolved Hide resolved
doc/graphql-api/User-GraphQL.md Outdated Show resolved Hide resolved
@Premwoik Premwoik requested a review from chrzaszcz July 13, 2022 08:21
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 13, 2022

small_tests_24 / small_tests / 85ef0f0
Reports root / small


small_tests_25 / small_tests / 85ef0f0
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 85ef0f0
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 85ef0f0
Reports root/ big
OK: 1739 / Failed: 0 / User-skipped: 460 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 85ef0f0
Reports root/ big
OK: 3105 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 85ef0f0
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 85ef0f0
Reports root/ big
OK: 3122 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 85ef0f0
Reports root/ big
OK: 1739 / Failed: 0 / User-skipped: 460 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 85ef0f0
Reports root/ big
OK: 3496 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 85ef0f0
Reports root/ big
OK: 1845 / Failed: 0 / User-skipped: 354 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 85ef0f0
Reports root/ big
OK: 2135 / Failed: 0 / User-skipped: 355 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 85ef0f0
Reports root/ big
OK: 1994 / Failed: 0 / User-skipped: 350 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 85ef0f0
Reports root/ big
OK: 3491 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 85ef0f0
Reports root/ big
OK: 3496 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 85ef0f0
Reports root/ big
OK: 3496 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good

@chrzaszcz chrzaszcz merged commit ecfb507 into master Jul 13, 2022
@chrzaszcz chrzaszcz deleted the document-graphql branch July 13, 2022 10:30
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
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.

None yet

4 participants